From 8731c33d436a431928ee0495a4bb8cac148a5f41 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 18:14:21 +0000 Subject: [PATCH] fix: update gapic-generator-java with mock service generation fixes (#833) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 457524730 Source-Link: https://github.com/googleapis/googleapis/commit/917e7f21cb1dc062744c6694437cdd46219f28cb Source-Link: https://github.com/googleapis/googleapis-gen/commit/2497f9a069d3f6b2d6810d5a4e239cda1e7e5a39 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ5N2Y5YTA2OWQzZjZiMmQ2ODEwZDVhNGUyMzljZGExZTdlNWEzOSJ9 feat: Enable REST transport for most of Java and Go clients PiperOrigin-RevId: 456641589 Source-Link: https://github.com/googleapis/googleapis/commit/8a251f5225b789b2383207ffd978f6aa3d77fcf7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9 chore: Integrate new gapic-generator-java and rules_gapic PiperOrigin-RevId: 454027580 Source-Link: https://github.com/googleapis/googleapis/commit/1b222777baa702e7135610355706570ed2b56318 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9 chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1 PiperOrigin-RevId: 450543911 Source-Link: https://github.com/googleapis/googleapis/commit/55283447ab72f10b6c2571d770af0498b593e84f Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f6775cab1958982b88967a43e5e806af0f135db Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9 chore(deps): upgrade gapic-generator-java to 2.7.0 and update gax-java to 2.16.0 PiperOrigin-RevId: 446250659 Source-Link: https://github.com/googleapis/googleapis/commit/dc4ef314fecf1b00833e78288cf2eb4d2b165ad1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5fdda4ddfbab87998e77e4a453e0ff87986d2db8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWZkZGE0ZGRmYmFiODc5OThlNzdlNGE0NTNlMGZmODc5ODZkMmRiOCJ9 chore(bazel): update version of Protobuf to v3.20.1 PiperOrigin-RevId: 444328399 Source-Link: https://github.com/googleapis/googleapis/commit/c7ca416c2856aad6a3f7092924e56b8cf0cb2534 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d61705453a62b3ecda78aa30c192840ebc5a8a90 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDYxNzA1NDUzYTYyYjNlY2RhNzhhYTMwYzE5Mjg0MGViYzVhOGE5MCJ9 fix: Move `yarn_config` into a `oneof` Committer: @harwayne PiperOrigin-RevId: 440226213 Source-Link: https://github.com/googleapis/googleapis/commit/c782e45288c42c411c41a2eca30bf4937c1e4edb Source-Link: https://github.com/googleapis/googleapis-gen/commit/d45c242ee81ffcbbb9eb985318ce897ac0d778af Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDQ1YzI0MmVlODFmZmNiYmI5ZWI5ODUzMThjZTg5N2FjMGQ3NzhhZiJ9 fix!: Remove `temp_bucket` from VirtualClusterConfig, as its value was not used Committer: @harwayne PiperOrigin-RevId: 440224385 Source-Link: https://github.com/googleapis/googleapis/commit/afc5066d9c3133493b93f83d39c03f10524efcaf Source-Link: https://github.com/googleapis/googleapis-gen/commit/07cf54aa66638cb92e2db6a6624cb3da9929740a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdjZjU0YWE2NjYzOGNiOTJlMmRiNmE2NjI0Y2IzZGE5OTI5NzQwYSJ9 --- java-dataproc/google-cloud-dataproc/pom.xml | 16 + .../v1/AutoscalingPolicyServiceClient.java | 73 +- .../v1/AutoscalingPolicyServiceSettings.java | 27 +- .../dataproc/v1/BatchControllerClient.java | 88 +- .../dataproc/v1/BatchControllerSettings.java | 27 +- .../dataproc/v1/ClusterControllerClient.java | 112 +- .../v1/ClusterControllerSettings.java | 27 +- .../dataproc/v1/JobControllerClient.java | 97 +- .../dataproc/v1/JobControllerSettings.java | 27 +- .../v1/WorkflowTemplateServiceClient.java | 166 ++- .../v1/WorkflowTemplateServiceSettings.java | 27 +- .../cloud/dataproc/v1/package-info.java | 12 +- .../v1/stub/AutoscalingPolicyServiceStub.java | 2 +- .../AutoscalingPolicyServiceStubSettings.java | 58 +- .../dataproc/v1/stub/BatchControllerStub.java | 8 +- .../v1/stub/BatchControllerStubSettings.java | 58 +- .../v1/stub/ClusterControllerStub.java | 8 +- .../stub/ClusterControllerStubSettings.java | 58 +- ...toscalingPolicyServiceCallableFactory.java | 2 +- .../GrpcAutoscalingPolicyServiceStub.java | 2 +- .../GrpcBatchControllerCallableFactory.java | 2 +- .../v1/stub/GrpcBatchControllerStub.java | 2 +- .../GrpcClusterControllerCallableFactory.java | 2 +- .../v1/stub/GrpcClusterControllerStub.java | 2 +- .../GrpcJobControllerCallableFactory.java | 2 +- .../v1/stub/GrpcJobControllerStub.java | 2 +- ...orkflowTemplateServiceCallableFactory.java | 2 +- .../stub/GrpcWorkflowTemplateServiceStub.java | 2 +- ...toscalingPolicyServiceCallableFactory.java | 105 ++ .../HttpJsonAutoscalingPolicyServiceStub.java | 452 +++++++ ...ttpJsonBatchControllerCallableFactory.java | 105 ++ .../v1/stub/HttpJsonBatchControllerStub.java | 389 +++++++ ...pJsonClusterControllerCallableFactory.java | 105 ++ .../stub/HttpJsonClusterControllerStub.java | 739 ++++++++++++ .../HttpJsonJobControllerCallableFactory.java | 105 ++ .../v1/stub/HttpJsonJobControllerStub.java | 563 +++++++++ ...orkflowTemplateServiceCallableFactory.java | 105 ++ .../HttpJsonWorkflowTemplateServiceStub.java | 626 ++++++++++ .../dataproc/v1/stub/JobControllerStub.java | 8 +- .../v1/stub/JobControllerStubSettings.java | 58 +- .../v1/stub/WorkflowTemplateServiceStub.java | 8 +- .../WorkflowTemplateServiceStubSettings.java | 58 +- ...calingPolicyServiceClientHttpJsonTest.java | 653 +++++++++++ .../AutoscalingPolicyServiceClientTest.java | 2 +- .../v1/BatchControllerClientHttpJsonTest.java | 502 ++++++++ .../v1/BatchControllerClientTest.java | 2 +- .../ClusterControllerClientHttpJsonTest.java | 616 ++++++++++ .../v1/ClusterControllerClientTest.java | 2 +- .../v1/JobControllerClientHttpJsonTest.java | 539 +++++++++ .../dataproc/v1/JobControllerClientTest.java | 2 +- .../v1/MockAutoscalingPolicyService.java | 2 +- .../v1/MockAutoscalingPolicyServiceImpl.java | 2 +- .../dataproc/v1/MockBatchController.java | 2 +- .../dataproc/v1/MockBatchControllerImpl.java | 2 +- .../dataproc/v1/MockClusterController.java | 2 +- .../v1/MockClusterControllerImpl.java | 2 +- .../cloud/dataproc/v1/MockJobController.java | 2 +- .../dataproc/v1/MockJobControllerImpl.java | 2 +- .../v1/MockWorkflowTemplateService.java | 2 +- .../v1/MockWorkflowTemplateServiceImpl.java | 2 +- ...flowTemplateServiceClientHttpJsonTest.java | 1037 +++++++++++++++++ .../v1/WorkflowTemplateServiceClientTest.java | 46 +- .../cloud/dataproc/v1/AcceleratorConfig.java | 2 + .../cloud/dataproc/v1/AutoscalingConfig.java | 2 + .../dataproc/v1/AutoscalingPoliciesProto.java | 150 +-- .../cloud/dataproc/v1/AutoscalingPolicy.java | 24 +- .../dataproc/v1/AutoscalingPolicyName.java | 2 +- .../v1/AutoscalingPolicyOrBuilder.java | 7 +- .../dataproc/v1/AuxiliaryServicesConfig.java | 2 + .../v1/BasicAutoscalingAlgorithm.java | 239 ++-- .../BasicAutoscalingAlgorithmOrBuilder.java | 2 + .../v1/BasicYarnAutoscalingConfig.java | 18 +- .../com/google/cloud/dataproc/v1/Batch.java | 35 +- .../google/cloud/dataproc/v1/BatchName.java | 2 +- .../dataproc/v1/BatchOperationMetadata.java | 21 +- .../v1/BatchOperationMetadataOrBuilder.java | 7 +- .../cloud/dataproc/v1/BatchOrBuilder.java | 7 +- .../cloud/dataproc/v1/CancelJobRequest.java | 2 + .../com/google/cloud/dataproc/v1/Cluster.java | 21 +- .../cloud/dataproc/v1/ClusterConfig.java | 2 + .../cloud/dataproc/v1/ClusterMetrics.java | 34 +- .../cloud/dataproc/v1/ClusterOperation.java | 2 + .../dataproc/v1/ClusterOperationMetadata.java | 21 +- .../v1/ClusterOperationMetadataOrBuilder.java | 7 +- .../dataproc/v1/ClusterOperationStatus.java | 2 + .../cloud/dataproc/v1/ClusterOrBuilder.java | 7 +- .../cloud/dataproc/v1/ClusterSelector.java | 21 +- .../dataproc/v1/ClusterSelectorOrBuilder.java | 7 +- .../cloud/dataproc/v1/ClusterStatus.java | 2 + .../cloud/dataproc/v1/ClustersProto.java | 470 ++++---- .../v1/ConfidentialInstanceConfig.java | 2 + .../v1/CreateAutoscalingPolicyRequest.java | 2 + .../cloud/dataproc/v1/CreateBatchRequest.java | 2 + .../dataproc/v1/CreateClusterRequest.java | 2 + .../v1/CreateWorkflowTemplateRequest.java | 2 + .../v1/DeleteAutoscalingPolicyRequest.java | 2 + .../cloud/dataproc/v1/DeleteBatchRequest.java | 2 + .../dataproc/v1/DeleteClusterRequest.java | 2 + .../cloud/dataproc/v1/DeleteJobRequest.java | 2 + .../v1/DeleteWorkflowTemplateRequest.java | 2 + .../dataproc/v1/DiagnoseClusterRequest.java | 2 + .../dataproc/v1/DiagnoseClusterResults.java | 2 + .../google/cloud/dataproc/v1/DiskConfig.java | 2 + .../cloud/dataproc/v1/EncryptionConfig.java | 2 + .../cloud/dataproc/v1/EndpointConfig.java | 21 +- .../dataproc/v1/EndpointConfigOrBuilder.java | 7 +- .../cloud/dataproc/v1/EnvironmentConfig.java | 2 + .../cloud/dataproc/v1/ExecutionConfig.java | 2 + .../cloud/dataproc/v1/GceClusterConfig.java | 21 +- .../v1/GceClusterConfigOrBuilder.java | 7 +- .../v1/GetAutoscalingPolicyRequest.java | 2 + .../cloud/dataproc/v1/GetBatchRequest.java | 2 + .../cloud/dataproc/v1/GetClusterRequest.java | 2 + .../cloud/dataproc/v1/GetJobRequest.java | 2 + .../v1/GetWorkflowTemplateRequest.java | 2 + .../cloud/dataproc/v1/GkeClusterConfig.java | 2 + .../cloud/dataproc/v1/GkeNodePoolConfig.java | 8 + .../cloud/dataproc/v1/GkeNodePoolTarget.java | 2 + .../google/cloud/dataproc/v1/HadoopJob.java | 21 +- .../cloud/dataproc/v1/HadoopJobOrBuilder.java | 7 +- .../com/google/cloud/dataproc/v1/HiveJob.java | 43 +- .../cloud/dataproc/v1/HiveJobOrBuilder.java | 14 +- .../cloud/dataproc/v1/IdentityConfig.java | 21 +- .../dataproc/v1/IdentityConfigOrBuilder.java | 6 +- .../InstanceGroupAutoscalingPolicyConfig.java | 2 + .../dataproc/v1/InstanceGroupConfig.java | 2 + ...tantiateInlineWorkflowTemplateRequest.java | 2 + .../InstantiateWorkflowTemplateRequest.java | 21 +- ...tiateWorkflowTemplateRequestOrBuilder.java | 7 +- .../com/google/cloud/dataproc/v1/Job.java | 45 +- .../google/cloud/dataproc/v1/JobMetadata.java | 2 + .../cloud/dataproc/v1/JobOrBuilder.java | 7 +- .../cloud/dataproc/v1/JobPlacement.java | 21 +- .../dataproc/v1/JobPlacementOrBuilder.java | 7 +- .../cloud/dataproc/v1/JobReference.java | 2 + .../cloud/dataproc/v1/JobScheduling.java | 2 + .../google/cloud/dataproc/v1/JobStatus.java | 2 + .../cloud/dataproc/v1/KerberosConfig.java | 2 + .../dataproc/v1/KubernetesClusterConfig.java | 5 +- .../dataproc/v1/KubernetesSoftwareConfig.java | 40 +- .../v1/KubernetesSoftwareConfigOrBuilder.java | 13 +- .../cloud/dataproc/v1/LifecycleConfig.java | 8 +- .../v1/ListAutoscalingPoliciesRequest.java | 2 + .../v1/ListAutoscalingPoliciesResponse.java | 2 + .../cloud/dataproc/v1/ListBatchesRequest.java | 2 + .../dataproc/v1/ListBatchesResponse.java | 2 + .../dataproc/v1/ListClustersRequest.java | 2 + .../dataproc/v1/ListClustersResponse.java | 2 + .../cloud/dataproc/v1/ListJobsRequest.java | 2 + .../cloud/dataproc/v1/ListJobsResponse.java | 2 + .../v1/ListWorkflowTemplatesRequest.java | 2 + .../v1/ListWorkflowTemplatesResponse.java | 2 + .../cloud/dataproc/v1/LocationName.java | 2 +- .../cloud/dataproc/v1/LoggingConfig.java | 47 +- .../dataproc/v1/LoggingConfigOrBuilder.java | 5 +- .../cloud/dataproc/v1/ManagedCluster.java | 21 +- .../dataproc/v1/ManagedClusterOrBuilder.java | 7 +- .../cloud/dataproc/v1/ManagedGroupConfig.java | 2 + .../cloud/dataproc/v1/MetastoreConfig.java | 2 + .../cloud/dataproc/v1/NodeGroupAffinity.java | 2 + .../dataproc/v1/NodeInitializationAction.java | 2 + .../google/cloud/dataproc/v1/OrderedJob.java | 45 +- .../dataproc/v1/OrderedJobOrBuilder.java | 7 +- .../dataproc/v1/ParameterValidation.java | 8 +- .../cloud/dataproc/v1/PeripheralsConfig.java | 2 + .../com/google/cloud/dataproc/v1/PigJob.java | 43 +- .../cloud/dataproc/v1/PigJobOrBuilder.java | 14 +- .../google/cloud/dataproc/v1/PrestoJob.java | 24 +- .../cloud/dataproc/v1/PrestoJobOrBuilder.java | 7 +- .../cloud/dataproc/v1/PySparkBatch.java | 2 + .../google/cloud/dataproc/v1/PySparkJob.java | 21 +- .../dataproc/v1/PySparkJobOrBuilder.java | 7 +- .../google/cloud/dataproc/v1/QueryList.java | 2 + .../cloud/dataproc/v1/RegexValidation.java | 2 + .../google/cloud/dataproc/v1/RegionName.java | 2 +- .../dataproc/v1/ReservationAffinity.java | 2 + .../cloud/dataproc/v1/RuntimeConfig.java | 21 +- .../dataproc/v1/RuntimeConfigOrBuilder.java | 7 +- .../google/cloud/dataproc/v1/RuntimeInfo.java | 21 +- .../dataproc/v1/RuntimeInfoOrBuilder.java | 7 +- .../cloud/dataproc/v1/SecurityConfig.java | 2 + .../dataproc/v1/ShieldedInstanceConfig.java | 2 + .../cloud/dataproc/v1/SoftwareConfig.java | 21 +- .../dataproc/v1/SoftwareConfigOrBuilder.java | 7 +- .../google/cloud/dataproc/v1/SparkBatch.java | 2 + .../dataproc/v1/SparkHistoryServerConfig.java | 2 + .../google/cloud/dataproc/v1/SparkJob.java | 21 +- .../cloud/dataproc/v1/SparkJobOrBuilder.java | 7 +- .../google/cloud/dataproc/v1/SparkRBatch.java | 2 + .../google/cloud/dataproc/v1/SparkRJob.java | 21 +- .../cloud/dataproc/v1/SparkRJobOrBuilder.java | 7 +- .../cloud/dataproc/v1/SparkSqlBatch.java | 21 +- .../dataproc/v1/SparkSqlBatchOrBuilder.java | 7 +- .../google/cloud/dataproc/v1/SparkSqlJob.java | 43 +- .../dataproc/v1/SparkSqlJobOrBuilder.java | 14 +- .../dataproc/v1/StartClusterRequest.java | 2 + .../cloud/dataproc/v1/StopClusterRequest.java | 2 + .../cloud/dataproc/v1/SubmitJobRequest.java | 2 + .../cloud/dataproc/v1/TemplateParameter.java | 2 + .../v1/UpdateAutoscalingPolicyRequest.java | 2 + .../dataproc/v1/UpdateClusterRequest.java | 2 + .../cloud/dataproc/v1/UpdateJobRequest.java | 2 + .../v1/UpdateWorkflowTemplateRequest.java | 2 + .../cloud/dataproc/v1/ValueValidation.java | 2 + .../dataproc/v1/VirtualClusterConfig.java | 268 +---- .../v1/VirtualClusterConfigOrBuilder.java | 49 - .../cloud/dataproc/v1/WorkflowGraph.java | 2 + .../cloud/dataproc/v1/WorkflowMetadata.java | 21 +- .../v1/WorkflowMetadataOrBuilder.java | 7 +- .../cloud/dataproc/v1/WorkflowNode.java | 2 + .../cloud/dataproc/v1/WorkflowTemplate.java | 21 +- .../dataproc/v1/WorkflowTemplateName.java | 2 +- .../v1/WorkflowTemplateOrBuilder.java | 7 +- .../v1/WorkflowTemplatePlacement.java | 8 +- .../cloud/dataproc/v1/YarnApplication.java | 6 +- .../dataproc/v1/autoscaling_policies.proto | 6 +- .../google/cloud/dataproc/v1/clusters.proto | 15 - .../SyncCreateSetCredentialsProvider.java | 42 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 39 + .../AsyncCreateAutoscalingPolicy.java | 49 + .../SyncCreateAutoscalingPolicy.java | 45 + ...ngPolicyLocationnameAutoscalingpolicy.java | 44 + ...lingPolicyRegionnameAutoscalingpolicy.java | 44 + ...oscalingPolicyStringAutoscalingpolicy.java | 44 + .../AsyncDeleteAutoscalingPolicy.java | 51 + .../SyncDeleteAutoscalingPolicy.java | 46 + ...utoscalingPolicyAutoscalingpolicyname.java | 43 + .../SyncDeleteAutoscalingPolicyString.java | 42 + .../AsyncGetAutoscalingPolicy.java | 51 + .../SyncGetAutoscalingPolicy.java | 47 + ...utoscalingPolicyAutoscalingpolicyname.java | 44 + .../SyncGetAutoscalingPolicyString.java | 43 + .../AsyncListAutoscalingPolicies.java | 52 + .../AsyncListAutoscalingPoliciesPaged.java | 60 + .../SyncListAutoscalingPolicies.java | 49 + ...ncListAutoscalingPoliciesLocationname.java | 45 + ...SyncListAutoscalingPoliciesRegionname.java | 45 + .../SyncListAutoscalingPoliciesString.java | 43 + .../AsyncUpdateAutoscalingPolicy.java | 47 + .../SyncUpdateAutoscalingPolicy.java | 43 + ...ateAutoscalingPolicyAutoscalingpolicy.java | 41 + .../SyncCreateAutoscalingPolicy.java | 47 + .../SyncCreateSetCredentialsProvider.java | 42 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 39 + .../createbatch/AsyncCreateBatch.java | 50 + .../createbatch/AsyncCreateBatchLRO.java | 51 + .../createbatch/SyncCreateBatch.java | 46 + ...yncCreateBatchLocationnameBatchString.java | 41 + .../SyncCreateBatchStringBatchString.java | 41 + .../deletebatch/AsyncDeleteBatch.java | 46 + .../deletebatch/SyncDeleteBatch.java | 42 + .../deletebatch/SyncDeleteBatchBatchname.java | 38 + .../deletebatch/SyncDeleteBatchString.java | 38 + .../getbatch/AsyncGetBatch.java | 46 + .../getbatch/SyncGetBatch.java | 43 + .../getbatch/SyncGetBatchBatchname.java | 39 + .../getbatch/SyncGetBatchString.java | 39 + .../listbatches/AsyncListBatches.java | 51 + .../listbatches/AsyncListBatchesPaged.java | 58 + .../listbatches/SyncListBatches.java | 47 + .../SyncListBatchesLocationname.java | 41 + .../listbatches/SyncListBatchesString.java | 41 + .../getbatch/SyncGetBatch.java | 46 + .../SyncCreateSetCredentialsProvider.java | 42 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 39 + .../createcluster/AsyncCreateCluster.java | 52 + .../createcluster/AsyncCreateClusterLRO.java | 52 + .../createcluster/SyncCreateCluster.java | 47 + .../SyncCreateClusterStringStringCluster.java | 41 + .../deletecluster/AsyncDeleteCluster.java | 50 + .../deletecluster/AsyncDeleteClusterLRO.java | 51 + .../deletecluster/SyncDeleteCluster.java | 45 + .../SyncDeleteClusterStringStringString.java | 39 + .../diagnosecluster/AsyncDiagnoseCluster.java | 48 + .../AsyncDiagnoseClusterLRO.java | 49 + .../diagnosecluster/SyncDiagnoseCluster.java | 44 + ...SyncDiagnoseClusterStringStringString.java | 41 + .../getcluster/AsyncGetCluster.java | 47 + .../getcluster/SyncGetCluster.java | 44 + .../SyncGetClusterStringStringString.java | 40 + .../listclusters/AsyncListClusters.java | 52 + .../listclusters/AsyncListClustersPaged.java | 60 + .../listclusters/SyncListClusters.java | 48 + .../SyncListClustersStringString.java | 41 + .../SyncListClustersStringStringString.java | 43 + .../startcluster/AsyncStartCluster.java | 50 + .../startcluster/AsyncStartClusterLRO.java | 51 + .../startcluster/SyncStartCluster.java | 46 + .../stopcluster/AsyncStopCluster.java | 50 + .../stopcluster/AsyncStopClusterLRO.java | 51 + .../stopcluster/SyncStopCluster.java | 46 + .../updatecluster/AsyncUpdateCluster.java | 55 + .../updatecluster/AsyncUpdateClusterLRO.java | 55 + .../updatecluster/SyncUpdateCluster.java | 50 + ...terStringStringStringClusterFieldmask.java | 48 + .../getcluster/SyncGetCluster.java | 46 + .../canceljob/AsyncCancelJob.java | 47 + .../canceljob/SyncCancelJob.java | 44 + .../SyncCancelJobStringStringString.java | 40 + .../SyncCreateSetCredentialsProvider.java | 41 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 38 + .../deletejob/AsyncDeleteJob.java | 47 + .../deletejob/SyncDeleteJob.java | 43 + .../SyncDeleteJobStringStringString.java | 39 + .../getjob/AsyncGetJob.java | 47 + .../getjob/SyncGetJob.java | 44 + .../getjob/SyncGetJobStringStringString.java | 40 + .../listjobs/AsyncListJobs.java | 52 + .../listjobs/AsyncListJobsPaged.java | 60 + .../listjobs/SyncListJobs.java | 49 + .../listjobs/SyncListJobsStringString.java | 41 + .../SyncListJobsStringStringString.java | 42 + .../submitjob/AsyncSubmitJob.java | 48 + .../submitjob/SyncSubmitJob.java | 45 + .../SyncSubmitJobStringStringJob.java | 40 + .../AsyncSubmitJobAsOperation.java | 50 + .../AsyncSubmitJobAsOperationLRO.java | 50 + .../SyncSubmitJobAsOperation.java | 45 + ...ncSubmitJobAsOperationStringStringJob.java | 40 + .../updatejob/AsyncUpdateJob.java | 50 + .../updatejob/SyncUpdateJob.java | 47 + .../submitjob/SyncSubmitJob.java | 45 + .../SyncCreateAutoscalingPolicy.java | 47 + .../getbatch/SyncGetBatch.java | 46 + .../getcluster/SyncGetCluster.java | 47 + .../submitjob/SyncSubmitJob.java | 46 + .../SyncCreateWorkflowTemplate.java | 47 + .../SyncCreateSetCredentialsProvider.java | 42 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 39 + .../AsyncCreateWorkflowTemplate.java | 49 + .../SyncCreateWorkflowTemplate.java | 45 + ...wTemplateLocationnameWorkflowtemplate.java | 44 + ...lowTemplateRegionnameWorkflowtemplate.java | 44 + ...orkflowTemplateStringWorkflowtemplate.java | 44 + .../AsyncDeleteWorkflowTemplate.java | 52 + .../SyncDeleteWorkflowTemplate.java | 47 + .../SyncDeleteWorkflowTemplateString.java | 42 + ...eWorkflowTemplateWorkflowtemplatename.java | 43 + .../AsyncGetWorkflowTemplate.java | 52 + .../SyncGetWorkflowTemplate.java | 48 + .../SyncGetWorkflowTemplateString.java | 43 + ...tWorkflowTemplateWorkflowtemplatename.java | 44 + ...syncInstantiateInlineWorkflowTemplate.java | 54 + ...cInstantiateInlineWorkflowTemplateLRO.java | 56 + ...SyncInstantiateInlineWorkflowTemplate.java | 47 + ...wTemplateLocationnameWorkflowtemplate.java | 44 + ...lowTemplateRegionnameWorkflowtemplate.java | 44 + ...orkflowTemplateStringWorkflowtemplate.java | 44 + .../AsyncInstantiateWorkflowTemplate.java | 55 + .../AsyncInstantiateWorkflowTemplateLRO.java | 58 + .../SyncInstantiateWorkflowTemplate.java | 50 + ...SyncInstantiateWorkflowTemplateString.java | 43 + ...WorkflowTemplateStringMapstringstring.java | 47 + ...eWorkflowTemplateWorkflowtemplatename.java | 43 + ...teWorkflowtemplatenameMapstringstring.java | 47 + .../AsyncListWorkflowTemplates.java | 52 + .../AsyncListWorkflowTemplatesPaged.java | 60 + .../SyncListWorkflowTemplates.java | 49 + ...SyncListWorkflowTemplatesLocationname.java | 44 + .../SyncListWorkflowTemplatesRegionname.java | 43 + .../SyncListWorkflowTemplatesString.java | 43 + .../AsyncUpdateWorkflowTemplate.java | 47 + .../SyncUpdateWorkflowTemplate.java | 43 + ...pdateWorkflowTemplateWorkflowtemplate.java | 41 + .../SyncCreateWorkflowTemplate.java | 47 + 370 files changed, 15991 insertions(+), 1286 deletions(-) create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceCallableFactory.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceStub.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerCallableFactory.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerStub.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerCallableFactory.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerStub.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerCallableFactory.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerStub.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceCallableFactory.java create mode 100644 java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceStub.java create mode 100644 java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientHttpJsonTest.java create mode 100644 java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientHttpJsonTest.java create mode 100644 java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientHttpJsonTest.java create mode 100644 java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientHttpJsonTest.java create mode 100644 java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientHttpJsonTest.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/AsyncCreateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyLocationnameAutoscalingpolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyRegionnameAutoscalingpolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyStringAutoscalingpolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/AsyncDeleteAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyAutoscalingpolicyname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/AsyncGetAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyAutoscalingpolicyname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPolicies.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPoliciesPaged.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPolicies.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesLocationname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesRegionname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/AsyncUpdateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicyAutoscalingpolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyservicesettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetEndpoint.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatchLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchLocationnameBatchString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchStringBatchString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/AsyncDeleteBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchBatchname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/AsyncGetBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchBatchname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatches.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatchesPaged.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatches.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesLocationname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollersettings/getbatch/SyncGetBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetEndpoint.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateClusterStringStringCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteClusterStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseClusterStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/AsyncGetCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetClusterStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClusters.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClustersPaged.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClusters.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/SyncStartCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/SyncStopCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateClusterLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateClusterStringStringStringClusterFieldmask.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollersettings/getcluster/SyncGetCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/AsyncCancelJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJobStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetEndpoint.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/AsyncDeleteJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJobStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/AsyncGetJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJobStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobs.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobsPaged.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobs.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringStringString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/AsyncSubmitJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJobStringStringJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperation.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperationLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperation.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperationStringStringJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/AsyncUpdateJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/SyncUpdateJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollersettings/submitjob/SyncSubmitJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/autoscalingpolicyservicestubsettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/batchcontrollerstubsettings/getbatch/SyncGetBatch.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/clustercontrollerstubsettings/getcluster/SyncGetCluster.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/jobcontrollerstubsettings/submitjob/SyncSubmitJob.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/workflowtemplateservicestubsettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/AsyncCreateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateLocationnameWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateRegionnameWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateStringWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/AsyncDeleteWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateWorkflowtemplatename.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/AsyncGetWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateWorkflowtemplatename.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplateLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateStringWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplateLRO.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateStringMapstringstring.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatename.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplates.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplatesPaged.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplates.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesLocationname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesRegionname.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesString.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/AsyncUpdateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplateWorkflowtemplate.java create mode 100644 java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateservicesettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java diff --git a/java-dataproc/google-cloud-dataproc/pom.xml b/java-dataproc/google-cloud-dataproc/pom.xml index 8c347ebe6991..91f6ded053f9 100644 --- a/java-dataproc/google-cloud-dataproc/pom.xml +++ b/java-dataproc/google-cloud-dataproc/pom.xml @@ -58,6 +58,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -81,12 +85,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java index af011a4447df..9f4bfa44f0f6 100644 --- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -42,6 +41,8 @@ * calls that map to API methods. Sample code to get started: * *
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
  *     AutoscalingPolicyServiceClient.create()) {
  *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -81,6 +82,8 @@
  * 

To customize credentials: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
  *     AutoscalingPolicyServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -92,12 +95,29 @@
  * 

To customize the endpoint: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
  *     AutoscalingPolicyServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
  *     AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
  * }
* + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings =
+ *     AutoscalingPolicyServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             AutoscalingPolicyServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
+ *     AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") @@ -124,7 +144,6 @@ public static final AutoscalingPolicyServiceClient create( * Constructs an instance of AutoscalingPolicyServiceClient, using the given stub for making * calls. This is for advanced usage - prefer using create(AutoscalingPolicyServiceSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AutoscalingPolicyServiceClient create(AutoscalingPolicyServiceStub stub) { return new AutoscalingPolicyServiceClient(stub); } @@ -140,7 +159,6 @@ protected AutoscalingPolicyServiceClient(AutoscalingPolicyServiceSettings settin this.stub = ((AutoscalingPolicyServiceStubSettings) settings.getStubSettings()).createStub(); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected AutoscalingPolicyServiceClient(AutoscalingPolicyServiceStub stub) { this.settings = null; this.stub = stub; @@ -150,7 +168,6 @@ public final AutoscalingPolicyServiceSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public AutoscalingPolicyServiceStub getStub() { return stub; } @@ -162,6 +179,8 @@ public AutoscalingPolicyServiceStub getStub() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -202,6 +221,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -242,6 +263,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
@@ -278,6 +301,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(String parent, Autoscalin
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   CreateAutoscalingPolicyRequest request =
@@ -303,6 +328,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   CreateAutoscalingPolicyRequest request =
@@ -331,6 +358,8 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
@@ -356,6 +385,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   UpdateAutoscalingPolicyRequest request =
@@ -382,6 +413,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   UpdateAutoscalingPolicyRequest request =
@@ -407,6 +440,8 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   AutoscalingPolicyName name =
@@ -446,6 +481,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(AutoscalingPolicyName name)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   String name =
@@ -484,6 +521,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   GetAutoscalingPolicyRequest request =
@@ -511,6 +550,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   GetAutoscalingPolicyRequest request =
@@ -539,6 +580,8 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -577,6 +620,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(Locati
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -615,6 +660,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(Region
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
@@ -651,6 +698,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(String
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   ListAutoscalingPoliciesRequest request =
@@ -681,6 +730,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   ListAutoscalingPoliciesRequest request =
@@ -710,6 +761,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   ListAutoscalingPoliciesRequest request =
@@ -721,7 +774,7 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
    *   while (true) {
    *     ListAutoscalingPoliciesResponse response =
    *         autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request);
-   *     for (AutoscalingPolicy element : response.getResponsesList()) {
+   *     for (AutoscalingPolicy element : response.getPoliciesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -747,6 +800,8 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   AutoscalingPolicyName name =
@@ -787,6 +842,8 @@ public final void deleteAutoscalingPolicy(AutoscalingPolicyName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   String name =
@@ -826,6 +883,8 @@ public final void deleteAutoscalingPolicy(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   DeleteAutoscalingPolicyRequest request =
@@ -854,6 +913,8 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
    *     AutoscalingPolicyServiceClient.create()) {
    *   DeleteAutoscalingPolicyRequest request =
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
index 28bc9d987f93..44d8018c90ad 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
@@ -53,6 +54,8 @@
  * 

For example, to set the total timeout of createAutoscalingPolicy to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
  *     AutoscalingPolicyServiceSettings.newBuilder();
  * autoscalingPolicyServiceSettingsBuilder
@@ -135,11 +138,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
     return AutoscalingPolicyServiceStubSettings.defaultCredentialsProviderBuilder();
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return AutoscalingPolicyServiceStubSettings.defaultGrpcTransportProviderBuilder();
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return AutoscalingPolicyServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return AutoscalingPolicyServiceStubSettings.defaultTransportChannelProvider();
   }
@@ -149,11 +159,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return AutoscalingPolicyServiceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  @BetaApi
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -192,6 +208,11 @@ private static Builder createDefault() {
       return new Builder(AutoscalingPolicyServiceStubSettings.newBuilder());
     }
 
+    @BetaApi
+    private static Builder createHttpJsonDefault() {
+      return new Builder(AutoscalingPolicyServiceStubSettings.newHttpJsonBuilder());
+    }
+
     public AutoscalingPolicyServiceStubSettings.Builder getStubSettingsBuilder() {
       return ((AutoscalingPolicyServiceStubSettings.Builder) getStubSettings());
     }
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerClient.java
index 6a52d75eba07..c8f26d1d7616 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerClient.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 import com.google.api.core.ApiFutures;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
 import com.google.api.gax.longrunning.OperationFuture;
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
 import com.google.cloud.dataproc.v1.stub.BatchControllerStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
 import com.google.protobuf.Empty;
 import java.io.IOException;
 import java.util.List;
@@ -46,6 +46,8 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
  *   BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
  *   Batch response = batchControllerClient.getBatch(name);
@@ -82,6 +84,8 @@
  * 

To customize credentials: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * BatchControllerSettings batchControllerSettings =
  *     BatchControllerSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -93,19 +97,37 @@
  * 

To customize the endpoint: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * BatchControllerSettings batchControllerSettings =
  *     BatchControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
  * BatchControllerClient batchControllerClient =
  *     BatchControllerClient.create(batchControllerSettings);
  * }
* + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * BatchControllerSettings batchControllerSettings =
+ *     BatchControllerSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             BatchControllerSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * BatchControllerClient batchControllerClient =
+ *     BatchControllerClient.create(batchControllerSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class BatchControllerClient implements BackgroundResource { private final BatchControllerSettings settings; private final BatchControllerStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of BatchControllerClient with default settings. */ public static final BatchControllerClient create() throws IOException { @@ -125,7 +147,6 @@ public static final BatchControllerClient create(BatchControllerSettings setting * Constructs an instance of BatchControllerClient, using the given stub for making calls. This is * for advanced usage - prefer using create(BatchControllerSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final BatchControllerClient create(BatchControllerStub stub) { return new BatchControllerClient(stub); } @@ -138,21 +159,23 @@ public static final BatchControllerClient create(BatchControllerStub stub) { protected BatchControllerClient(BatchControllerSettings settings) throws IOException { this.settings = settings; this.stub = ((BatchControllerStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected BatchControllerClient(BatchControllerStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final BatchControllerSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public BatchControllerStub getStub() { return stub; } @@ -161,10 +184,19 @@ public BatchControllerStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a batch workload that executes asynchronously. @@ -172,6 +204,8 @@ public final OperationsClient getOperationsClient() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
    *   Batch batch = Batch.newBuilder().build();
@@ -205,6 +239,8 @@ public final OperationFuture createBatchAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   Batch batch = Batch.newBuilder().build();
@@ -238,6 +274,8 @@ public final OperationFuture createBatchAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   CreateBatchRequest request =
    *       CreateBatchRequest.newBuilder()
@@ -265,6 +303,8 @@ public final OperationFuture createBatchAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   CreateBatchRequest request =
    *       CreateBatchRequest.newBuilder()
@@ -292,6 +332,8 @@ public final OperationFuture createBatchAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   CreateBatchRequest request =
    *       CreateBatchRequest.newBuilder()
@@ -317,6 +359,8 @@ public final UnaryCallable createBatchCallable()
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
    *   Batch response = batchControllerClient.getBatch(name);
@@ -339,6 +383,8 @@ public final Batch getBatch(BatchName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   String name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString();
    *   Batch response = batchControllerClient.getBatch(name);
@@ -360,6 +406,8 @@ public final Batch getBatch(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   GetBatchRequest request =
    *       GetBatchRequest.newBuilder()
@@ -383,6 +431,8 @@ public final Batch getBatch(GetBatchRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   GetBatchRequest request =
    *       GetBatchRequest.newBuilder()
@@ -405,6 +455,8 @@ public final UnaryCallable getBatchCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
    *   for (Batch element : batchControllerClient.listBatches(parent).iterateAll()) {
@@ -431,6 +483,8 @@ public final ListBatchesPagedResponse listBatches(LocationName parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   for (Batch element : batchControllerClient.listBatches(parent).iterateAll()) {
@@ -454,6 +508,8 @@ public final ListBatchesPagedResponse listBatches(String parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   ListBatchesRequest request =
    *       ListBatchesRequest.newBuilder()
@@ -481,6 +537,8 @@ public final ListBatchesPagedResponse listBatches(ListBatchesRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   ListBatchesRequest request =
    *       ListBatchesRequest.newBuilder()
@@ -509,6 +567,8 @@ public final ListBatchesPagedResponse listBatches(ListBatchesRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   ListBatchesRequest request =
    *       ListBatchesRequest.newBuilder()
@@ -518,7 +578,7 @@ public final ListBatchesPagedResponse listBatches(ListBatchesRequest request) {
    *           .build();
    *   while (true) {
    *     ListBatchesResponse response = batchControllerClient.listBatchesCallable().call(request);
-   *     for (Batch element : response.getResponsesList()) {
+   *     for (Batch element : response.getBatchesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -543,6 +603,8 @@ public final UnaryCallable listBatchesC
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
    *   batchControllerClient.deleteBatch(name);
@@ -566,6 +628,8 @@ public final void deleteBatch(BatchName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   String name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString();
    *   batchControllerClient.deleteBatch(name);
@@ -588,6 +652,8 @@ public final void deleteBatch(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   DeleteBatchRequest request =
    *       DeleteBatchRequest.newBuilder()
@@ -612,6 +678,8 @@ public final void deleteBatch(DeleteBatchRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
    *   DeleteBatchRequest request =
    *       DeleteBatchRequest.newBuilder()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerSettings.java
index 0aceb61d3719..a52bdd7df200 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/BatchControllerSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
@@ -55,6 +56,8 @@
  * 

For example, to set the total timeout of getBatch to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * BatchControllerSettings.Builder batchControllerSettingsBuilder =
  *     BatchControllerSettings.newBuilder();
  * batchControllerSettingsBuilder
@@ -124,11 +127,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
     return BatchControllerStubSettings.defaultCredentialsProviderBuilder();
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return BatchControllerStubSettings.defaultGrpcTransportProviderBuilder();
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return BatchControllerStubSettings.defaultHttpJsonTransportProviderBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return BatchControllerStubSettings.defaultTransportChannelProvider();
   }
@@ -138,11 +148,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return BatchControllerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  @BetaApi
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -180,6 +196,11 @@ private static Builder createDefault() {
       return new Builder(BatchControllerStubSettings.newBuilder());
     }
 
+    @BetaApi
+    private static Builder createHttpJsonDefault() {
+      return new Builder(BatchControllerStubSettings.newHttpJsonBuilder());
+    }
+
     public BatchControllerStubSettings.Builder getStubSettingsBuilder() {
       return ((BatchControllerStubSettings.Builder) getStubSettings());
     }
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
index 9cf9ec25ffef..5cecf3207d4e 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 import com.google.api.core.ApiFutures;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
 import com.google.api.gax.longrunning.OperationFuture;
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
 import com.google.cloud.dataproc.v1.stub.ClusterControllerStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
 import com.google.protobuf.Empty;
 import com.google.protobuf.FieldMask;
 import java.io.IOException;
@@ -48,6 +48,8 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String region = "region-934795532";
@@ -86,6 +88,8 @@
  * 

To customize credentials: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * ClusterControllerSettings clusterControllerSettings =
  *     ClusterControllerSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -97,19 +101,37 @@
  * 

To customize the endpoint: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * ClusterControllerSettings clusterControllerSettings =
  *     ClusterControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
  * ClusterControllerClient clusterControllerClient =
  *     ClusterControllerClient.create(clusterControllerSettings);
  * }
* + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ClusterControllerSettings clusterControllerSettings =
+ *     ClusterControllerSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             ClusterControllerSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * ClusterControllerClient clusterControllerClient =
+ *     ClusterControllerClient.create(clusterControllerSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class ClusterControllerClient implements BackgroundResource { private final ClusterControllerSettings settings; private final ClusterControllerStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of ClusterControllerClient with default settings. */ public static final ClusterControllerClient create() throws IOException { @@ -129,7 +151,6 @@ public static final ClusterControllerClient create(ClusterControllerSettings set * Constructs an instance of ClusterControllerClient, using the given stub for making calls. This * is for advanced usage - prefer using create(ClusterControllerSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final ClusterControllerClient create(ClusterControllerStub stub) { return new ClusterControllerClient(stub); } @@ -142,21 +163,23 @@ public static final ClusterControllerClient create(ClusterControllerStub stub) { protected ClusterControllerClient(ClusterControllerSettings settings) throws IOException { this.settings = settings; this.stub = ((ClusterControllerStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected ClusterControllerClient(ClusterControllerStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final ClusterControllerSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ClusterControllerStub getStub() { return stub; } @@ -165,10 +188,19 @@ public ClusterControllerStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a cluster in a project. The returned @@ -178,6 +210,8 @@ public final OperationsClient getOperationsClient() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -213,6 +247,8 @@ public final OperationFuture createClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   CreateClusterRequest request =
    *       CreateClusterRequest.newBuilder()
@@ -243,6 +279,8 @@ public final OperationFuture createClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   CreateClusterRequest request =
    *       CreateClusterRequest.newBuilder()
@@ -273,6 +311,8 @@ public final OperationFuture createClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   CreateClusterRequest request =
    *       CreateClusterRequest.newBuilder()
@@ -304,6 +344,8 @@ public final UnaryCallable createClusterCallabl
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -368,6 +410,8 @@ public final OperationFuture updateClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   UpdateClusterRequest request =
    *       UpdateClusterRequest.newBuilder()
@@ -402,6 +446,8 @@ public final OperationFuture updateClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   UpdateClusterRequest request =
    *       UpdateClusterRequest.newBuilder()
@@ -436,6 +482,8 @@ public final OperationFuture updateClusterAsy
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   UpdateClusterRequest request =
    *       UpdateClusterRequest.newBuilder()
@@ -465,6 +513,8 @@ public final UnaryCallable updateClusterCallabl
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StopClusterRequest request =
    *       StopClusterRequest.newBuilder()
@@ -493,6 +543,8 @@ public final OperationFuture stopClusterAsync
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StopClusterRequest request =
    *       StopClusterRequest.newBuilder()
@@ -521,6 +573,8 @@ public final OperationFuture stopClusterAsync
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StopClusterRequest request =
    *       StopClusterRequest.newBuilder()
@@ -548,6 +602,8 @@ public final UnaryCallable stopClusterCallable()
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StartClusterRequest request =
    *       StartClusterRequest.newBuilder()
@@ -576,6 +632,8 @@ public final OperationFuture startClusterAsyn
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StartClusterRequest request =
    *       StartClusterRequest.newBuilder()
@@ -604,6 +662,8 @@ public final OperationFuture startClusterAsyn
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   StartClusterRequest request =
    *       StartClusterRequest.newBuilder()
@@ -633,6 +693,8 @@ public final UnaryCallable startClusterCallable(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -667,6 +729,8 @@ public final OperationFuture deleteClusterAsync
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DeleteClusterRequest request =
    *       DeleteClusterRequest.newBuilder()
@@ -697,6 +761,8 @@ public final OperationFuture deleteClusterAsync
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DeleteClusterRequest request =
    *       DeleteClusterRequest.newBuilder()
@@ -727,6 +793,8 @@ public final OperationFuture deleteClusterAsync
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DeleteClusterRequest request =
    *       DeleteClusterRequest.newBuilder()
@@ -754,6 +822,8 @@ public final UnaryCallable deleteClusterCallabl
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -785,6 +855,8 @@ public final Cluster getCluster(String projectId, String region, String clusterN
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   GetClusterRequest request =
    *       GetClusterRequest.newBuilder()
@@ -810,6 +882,8 @@ public final Cluster getCluster(GetClusterRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   GetClusterRequest request =
    *       GetClusterRequest.newBuilder()
@@ -834,6 +908,8 @@ public final UnaryCallable getClusterCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -861,6 +937,8 @@ public final ListClustersPagedResponse listClusters(String projectId, String reg
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -909,6 +987,8 @@ public final ListClustersPagedResponse listClusters(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   ListClustersRequest request =
    *       ListClustersRequest.newBuilder()
@@ -938,6 +1018,8 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   ListClustersRequest request =
    *       ListClustersRequest.newBuilder()
@@ -968,6 +1050,8 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   ListClustersRequest request =
    *       ListClustersRequest.newBuilder()
@@ -980,7 +1064,7 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request)
    *   while (true) {
    *     ListClustersResponse response =
    *         clusterControllerClient.listClustersCallable().call(request);
-   *     for (Cluster element : response.getResponsesList()) {
+   *     for (Cluster element : response.getClustersList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1009,6 +1093,8 @@ public final UnaryCallable listCluste
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -1047,6 +1133,8 @@ public final UnaryCallable listCluste
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DiagnoseClusterRequest request =
    *       DiagnoseClusterRequest.newBuilder()
@@ -1078,6 +1166,8 @@ public final UnaryCallable listCluste
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DiagnoseClusterRequest request =
    *       DiagnoseClusterRequest.newBuilder()
@@ -1110,6 +1200,8 @@ public final UnaryCallable listCluste
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
    *   DiagnoseClusterRequest request =
    *       DiagnoseClusterRequest.newBuilder()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
index b608594b1861..55d39d98e9f1 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
@@ -55,6 +56,8 @@
  * 

For example, to set the total timeout of getCluster to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * ClusterControllerSettings.Builder clusterControllerSettingsBuilder =
  *     ClusterControllerSettings.newBuilder();
  * clusterControllerSettingsBuilder
@@ -175,11 +178,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
     return ClusterControllerStubSettings.defaultCredentialsProviderBuilder();
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return ClusterControllerStubSettings.defaultGrpcTransportProviderBuilder();
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return ClusterControllerStubSettings.defaultHttpJsonTransportProviderBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return ClusterControllerStubSettings.defaultTransportChannelProvider();
   }
@@ -189,11 +199,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return ClusterControllerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  @BetaApi
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -231,6 +247,11 @@ private static Builder createDefault() {
       return new Builder(ClusterControllerStubSettings.newBuilder());
     }
 
+    @BetaApi
+    private static Builder createHttpJsonDefault() {
+      return new Builder(ClusterControllerStubSettings.newHttpJsonBuilder());
+    }
+
     public ClusterControllerStubSettings.Builder getStubSettingsBuilder() {
       return ((ClusterControllerStubSettings.Builder) getStubSettings());
     }
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
index d052c400b89e..58cfd102b15c 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 import com.google.api.core.ApiFutures;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
 import com.google.api.gax.longrunning.OperationFuture;
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
 import com.google.cloud.dataproc.v1.stub.JobControllerStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
 import com.google.protobuf.Empty;
 import java.io.IOException;
 import java.util.List;
@@ -46,6 +46,8 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String region = "region-934795532";
@@ -83,6 +85,8 @@
  * 

To customize credentials: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * JobControllerSettings jobControllerSettings =
  *     JobControllerSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -93,18 +97,35 @@
  * 

To customize the endpoint: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * JobControllerSettings jobControllerSettings =
  *     JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
  * JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings);
  * }
* + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * JobControllerSettings jobControllerSettings =
+ *     JobControllerSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             JobControllerSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class JobControllerClient implements BackgroundResource { private final JobControllerSettings settings; private final JobControllerStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of JobControllerClient with default settings. */ public static final JobControllerClient create() throws IOException { @@ -124,7 +145,6 @@ public static final JobControllerClient create(JobControllerSettings settings) * Constructs an instance of JobControllerClient, using the given stub for making calls. This is * for advanced usage - prefer using create(JobControllerSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final JobControllerClient create(JobControllerStub stub) { return new JobControllerClient(stub); } @@ -137,21 +157,23 @@ public static final JobControllerClient create(JobControllerStub stub) { protected JobControllerClient(JobControllerSettings settings) throws IOException { this.settings = settings; this.stub = ((JobControllerStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected JobControllerClient(JobControllerStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final JobControllerSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public JobControllerStub getStub() { return stub; } @@ -160,10 +182,19 @@ public JobControllerStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Submits a job to a cluster. @@ -171,6 +202,8 @@ public final OperationsClient getOperationsClient() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -197,6 +230,8 @@ public final Job submitJob(String projectId, String region, Job job) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   SubmitJobRequest request =
    *       SubmitJobRequest.newBuilder()
@@ -223,6 +258,8 @@ public final Job submitJob(SubmitJobRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   SubmitJobRequest request =
    *       SubmitJobRequest.newBuilder()
@@ -248,6 +285,8 @@ public final UnaryCallable submitJobCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -275,6 +314,8 @@ public final OperationFuture submitJobAsOperationAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   SubmitJobRequest request =
    *       SubmitJobRequest.newBuilder()
@@ -302,6 +343,8 @@ public final OperationFuture submitJobAsOperationAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   SubmitJobRequest request =
    *       SubmitJobRequest.newBuilder()
@@ -329,6 +372,8 @@ public final OperationFuture submitJobAsOperationAsync(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   SubmitJobRequest request =
    *       SubmitJobRequest.newBuilder()
@@ -355,6 +400,8 @@ public final UnaryCallable submitJobAsOperationCall
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -385,6 +432,8 @@ public final Job getJob(String projectId, String region, String jobId) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   GetJobRequest request =
    *       GetJobRequest.newBuilder()
@@ -410,6 +459,8 @@ public final Job getJob(GetJobRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   GetJobRequest request =
    *       GetJobRequest.newBuilder()
@@ -434,6 +485,8 @@ public final UnaryCallable getJobCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -460,6 +513,8 @@ public final ListJobsPagedResponse listJobs(String projectId, String region) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -500,6 +555,8 @@ public final ListJobsPagedResponse listJobs(String projectId, String region, Str
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   ListJobsRequest request =
    *       ListJobsRequest.newBuilder()
@@ -530,6 +587,8 @@ public final ListJobsPagedResponse listJobs(ListJobsRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   ListJobsRequest request =
    *       ListJobsRequest.newBuilder()
@@ -559,6 +618,8 @@ public final UnaryCallable listJobsPaged
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   ListJobsRequest request =
    *       ListJobsRequest.newBuilder()
@@ -571,7 +632,7 @@ public final UnaryCallable listJobsPaged
    *           .build();
    *   while (true) {
    *     ListJobsResponse response = jobControllerClient.listJobsCallable().call(request);
-   *     for (Job element : response.getResponsesList()) {
+   *     for (Job element : response.getJobsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -595,6 +656,8 @@ public final UnaryCallable listJobsCallable()
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   UpdateJobRequest request =
    *       UpdateJobRequest.newBuilder()
@@ -622,6 +685,8 @@ public final Job updateJob(UpdateJobRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   UpdateJobRequest request =
    *       UpdateJobRequest.newBuilder()
@@ -651,6 +716,8 @@ public final UnaryCallable updateJobCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -684,6 +751,8 @@ public final Job cancelJob(String projectId, String region, String jobId) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   CancelJobRequest request =
    *       CancelJobRequest.newBuilder()
@@ -712,6 +781,8 @@ public final Job cancelJob(CancelJobRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   CancelJobRequest request =
    *       CancelJobRequest.newBuilder()
@@ -737,6 +808,8 @@ public final UnaryCallable cancelJobCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   String projectId = "projectId-894832108";
    *   String region = "region-934795532";
@@ -768,6 +841,8 @@ public final void deleteJob(String projectId, String region, String jobId) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   DeleteJobRequest request =
    *       DeleteJobRequest.newBuilder()
@@ -794,6 +869,8 @@ public final void deleteJob(DeleteJobRequest request) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
    *   DeleteJobRequest request =
    *       DeleteJobRequest.newBuilder()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
index 4a443d1068cd..71bc0b5e3666 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
@@ -55,6 +56,8 @@
  * 

For example, to set the total timeout of submitJob to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * JobControllerSettings.Builder jobControllerSettingsBuilder = JobControllerSettings.newBuilder();
  * jobControllerSettingsBuilder
  *     .submitJobSettings()
@@ -138,11 +141,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
     return JobControllerStubSettings.defaultCredentialsProviderBuilder();
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return JobControllerStubSettings.defaultGrpcTransportProviderBuilder();
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return JobControllerStubSettings.defaultHttpJsonTransportProviderBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return JobControllerStubSettings.defaultTransportChannelProvider();
   }
@@ -152,11 +162,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return JobControllerStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  @BetaApi
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -194,6 +210,11 @@ private static Builder createDefault() {
       return new Builder(JobControllerStubSettings.newBuilder());
     }
 
+    @BetaApi
+    private static Builder createHttpJsonDefault() {
+      return new Builder(JobControllerStubSettings.newHttpJsonBuilder());
+    }
+
     public JobControllerStubSettings.Builder getStubSettingsBuilder() {
       return ((JobControllerStubSettings.Builder) getStubSettings());
     }
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
index c9478f493427..8d0650988a62 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 import com.google.api.core.ApiFutures;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.httpjson.longrunning.OperationsClient;
 import com.google.api.gax.longrunning.OperationFuture;
 import com.google.api.gax.paging.AbstractFixedSizeCollection;
 import com.google.api.gax.paging.AbstractPage;
@@ -31,7 +32,6 @@
 import com.google.cloud.dataproc.v1.stub.WorkflowTemplateServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.longrunning.Operation;
-import com.google.longrunning.OperationsClient;
 import com.google.protobuf.Empty;
 import java.io.IOException;
 import java.util.List;
@@ -47,6 +47,8 @@
  * calls that map to API methods. Sample code to get started:
  *
  * 
{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
  *     WorkflowTemplateServiceClient.create()) {
  *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -86,6 +88,8 @@
  * 

To customize credentials: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
  *     WorkflowTemplateServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
@@ -97,19 +101,37 @@
  * 

To customize the endpoint: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
  *     WorkflowTemplateServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * WorkflowTemplateServiceClient workflowTemplateServiceClient =
  *     WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
  * }
* + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
+ *     WorkflowTemplateServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             WorkflowTemplateServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * WorkflowTemplateServiceClient workflowTemplateServiceClient =
+ *     WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class WorkflowTemplateServiceClient implements BackgroundResource { private final WorkflowTemplateServiceSettings settings; private final WorkflowTemplateServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of WorkflowTemplateServiceClient with default settings. */ public static final WorkflowTemplateServiceClient create() throws IOException { @@ -129,7 +151,6 @@ public static final WorkflowTemplateServiceClient create(WorkflowTemplateService * Constructs an instance of WorkflowTemplateServiceClient, using the given stub for making calls. * This is for advanced usage - prefer using create(WorkflowTemplateServiceSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceStub stub) { return new WorkflowTemplateServiceClient(stub); } @@ -143,21 +164,23 @@ protected WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings throws IOException { this.settings = settings; this.stub = ((WorkflowTemplateServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final WorkflowTemplateServiceSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public WorkflowTemplateServiceStub getStub() { return stub; } @@ -166,10 +189,19 @@ public WorkflowTemplateServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates new workflow template. @@ -177,6 +209,8 @@ public final OperationsClient getOperationsClient() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -217,6 +251,8 @@ public final WorkflowTemplate createWorkflowTemplate(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -257,6 +293,8 @@ public final WorkflowTemplate createWorkflowTemplate(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
@@ -293,6 +331,8 @@ public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemp
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   CreateWorkflowTemplateRequest request =
@@ -318,6 +358,8 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   CreateWorkflowTemplateRequest request =
@@ -346,11 +388,13 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name =
-   *       WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *           "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *       WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *           "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
    *   WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
    * }
    * }
@@ -387,6 +431,8 @@ public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String name =
@@ -427,13 +473,15 @@ public final WorkflowTemplate getWorkflowTemplate(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   GetWorkflowTemplateRequest request =
    *       GetWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .build();
@@ -457,13 +505,15 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   GetWorkflowTemplateRequest request =
    *       GetWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .build();
@@ -502,11 +552,13 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name =
-   *       WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *           "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *       WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *           "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
    *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
    * }
    * }
@@ -558,6 +610,8 @@ public final OperationFuture instantiateWorkflowTemplat *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String name =
@@ -613,11 +667,13 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name =
-   *       WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *           "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *       WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *           "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
    *   Map parameters = new HashMap<>();
    *   workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
    * }
@@ -673,6 +729,8 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String name =
@@ -734,13 +792,15 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateWorkflowTemplateRequest request =
    *       InstantiateWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .setRequestId("requestId693933066")
@@ -781,13 +841,15 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateWorkflowTemplateRequest request =
    *       InstantiateWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .setRequestId("requestId693933066")
@@ -830,13 +892,15 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateWorkflowTemplateRequest request =
    *       InstantiateWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .setRequestId("requestId693933066")
@@ -882,6 +946,8 @@ public final OperationFuture instantiateWorkflowTemplat
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -942,6 +1008,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -1002,6 +1070,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
@@ -1062,6 +1132,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateInlineWorkflowTemplateRequest request =
@@ -1110,6 +1182,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateInlineWorkflowTemplateRequest request =
@@ -1160,6 +1234,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   InstantiateInlineWorkflowTemplateRequest request =
@@ -1190,6 +1266,8 @@ public final OperationFuture instantiateInlineWorkflowT
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
@@ -1215,6 +1293,8 @@ public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   UpdateWorkflowTemplateRequest request =
@@ -1240,6 +1320,8 @@ public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateReque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   UpdateWorkflowTemplateRequest request =
@@ -1265,6 +1347,8 @@ public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateReque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -1303,6 +1387,8 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(LocationNa
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
@@ -1341,6 +1427,8 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String parent = RegionName.of("[PROJECT]", "[REGION]").toString();
@@ -1377,6 +1465,8 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(String par
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   ListWorkflowTemplatesRequest request =
@@ -1407,6 +1497,8 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   ListWorkflowTemplatesRequest request =
@@ -1436,6 +1528,8 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   ListWorkflowTemplatesRequest request =
@@ -1447,7 +1541,7 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
    *   while (true) {
    *     ListWorkflowTemplatesResponse response =
    *         workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request);
-   *     for (WorkflowTemplate element : response.getResponsesList()) {
+   *     for (WorkflowTemplate element : response.getTemplatesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1472,11 +1566,13 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   WorkflowTemplateName name =
-   *       WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *           "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+   *       WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *           "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
    *   workflowTemplateServiceClient.deleteWorkflowTemplate(name);
    * }
    * }
@@ -1511,6 +1607,8 @@ public final void deleteWorkflowTemplate(WorkflowTemplateName name) { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   String name =
@@ -1549,13 +1647,15 @@ public final void deleteWorkflowTemplate(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   DeleteWorkflowTemplateRequest request =
    *       DeleteWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .build();
@@ -1577,13 +1677,15 @@ public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request)
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
    * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
    *     WorkflowTemplateServiceClient.create()) {
    *   DeleteWorkflowTemplateRequest request =
    *       DeleteWorkflowTemplateRequest.newBuilder()
    *           .setName(
-   *               WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-   *                       "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+   *               WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+   *                       "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
    *                   .toString())
    *           .setVersion(351608024)
    *           .build();
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java
index 9502edcb289f..88c8dfc287e6 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.ClientContext;
 import com.google.api.gax.rpc.ClientSettings;
@@ -55,6 +56,8 @@
  * 

For example, to set the total timeout of createWorkflowTemplate to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * WorkflowTemplateServiceSettings.Builder workflowTemplateServiceSettingsBuilder =
  *     WorkflowTemplateServiceSettings.newBuilder();
  * workflowTemplateServiceSettingsBuilder
@@ -163,11 +166,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
     return WorkflowTemplateServiceStubSettings.defaultCredentialsProviderBuilder();
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return WorkflowTemplateServiceStubSettings.defaultGrpcTransportProviderBuilder();
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return WorkflowTemplateServiceStubSettings.defaultHttpJsonTransportProviderBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return WorkflowTemplateServiceStubSettings.defaultTransportChannelProvider();
   }
@@ -177,11 +187,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
     return WorkflowTemplateServiceStubSettings.defaultApiClientHeaderProviderBuilder();
   }
 
-  /** Returns a new builder for this class. */
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  @BetaApi
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -220,6 +236,11 @@ private static Builder createDefault() {
       return new Builder(WorkflowTemplateServiceStubSettings.newBuilder());
     }
 
+    @BetaApi
+    private static Builder createHttpJsonDefault() {
+      return new Builder(WorkflowTemplateServiceStubSettings.newHttpJsonBuilder());
+    }
+
     public WorkflowTemplateServiceStubSettings.Builder getStubSettingsBuilder() {
       return ((WorkflowTemplateServiceStubSettings.Builder) getStubSettings());
     }
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
index ff77c4df1731..df1f4105bf6a 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,8 @@
  * 

Sample for AutoscalingPolicyServiceClient: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
  *     AutoscalingPolicyServiceClient.create()) {
  *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
@@ -40,6 +42,8 @@
  * 

Sample for BatchControllerClient: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) {
  *   BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
  *   Batch response = batchControllerClient.getBatch(name);
@@ -54,6 +58,8 @@
  * 

Sample for ClusterControllerClient: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String region = "region-934795532";
@@ -69,6 +75,8 @@
  * 

Sample for JobControllerClient: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
  *   String projectId = "projectId-894832108";
  *   String region = "region-934795532";
@@ -84,6 +92,8 @@
  * 

Sample for WorkflowTemplateServiceClient: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * try (WorkflowTemplateServiceClient workflowTemplateServiceClient =
  *     WorkflowTemplateServiceClient.create()) {
  *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
index a4cb2d3b1dd9..71613b6da693 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
index d32c58ce17a9..1a2a5e94b665 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStubSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,9 @@
 import com.google.api.gax.grpc.GaxGrpcProperties;
 import com.google.api.gax.grpc.GrpcTransportChannel;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.retrying.RetrySettings;
 import com.google.api.gax.rpc.ApiCallContext;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
@@ -75,6 +78,8 @@
  * 

For example, to set the total timeout of createAutoscalingPolicy to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder =
  *     AutoscalingPolicyServiceStubSettings.newBuilder();
  * autoscalingPolicyServiceSettingsBuilder
@@ -216,13 +221,17 @@ public ApiFuture getFuturePagedResponse(
     return deleteAutoscalingPolicySettings;
   }
 
-  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public AutoscalingPolicyServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
         .getTransportName()
         .equals(GrpcTransportChannel.getGrpcTransportName())) {
       return GrpcAutoscalingPolicyServiceStub.create(this);
     }
+    if (getTransportChannelProvider()
+        .getTransportName()
+        .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+      return HttpJsonAutoscalingPolicyServiceStub.create(this);
+    }
     throw new UnsupportedOperationException(
         String.format(
             "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -255,18 +264,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
         .setUseJwtAccessWithScope(true);
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return InstantiatingGrpcChannelProvider.newBuilder()
         .setMaxInboundMessageSize(Integer.MAX_VALUE);
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return InstantiatingHttpJsonChannelProvider.newBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return defaultGrpcTransportProviderBuilder().build();
   }
 
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
-  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+  public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken(
             "gapic", GaxProperties.getLibraryVersion(AutoscalingPolicyServiceStubSettings.class))
@@ -274,11 +290,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
             GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
   }
 
-  /** Returns a new builder for this class. */
+  @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+  public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+    return ApiClientHeaderProvider.newBuilder()
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(AutoscalingPolicyServiceStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
+  }
+
+  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+    return AutoscalingPolicyServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+  }
+
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -414,6 +449,19 @@ private static Builder createDefault() {
       return initDefaults(builder);
     }
 
+    private static Builder createHttpJsonDefault() {
+      Builder builder = new Builder(((ClientContext) null));
+
+      builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+      builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+      builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+      builder.setEndpoint(getDefaultEndpoint());
+      builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+      builder.setSwitchToMtlsEndpointAllowed(true);
+
+      return initDefaults(builder);
+    }
+
     private static Builder initDefaults(Builder builder) {
       builder
           .createAutoscalingPolicySettings()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStub.java
index 3c8721b8f1cd..83554c32b5c0 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,11 @@
 public abstract class BatchControllerStub implements BackgroundResource {
 
   public OperationsStub getOperationsStub() {
-    throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+    return null;
+  }
+
+  public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+    return null;
   }
 
   public OperationCallable
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStubSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStubSettings.java
index 793163de952b..832821dc9090 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStubSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/BatchControllerStubSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,9 @@
 import com.google.api.gax.grpc.GrpcTransportChannel;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
 import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.longrunning.OperationSnapshot;
 import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
 import com.google.api.gax.retrying.RetrySettings;
@@ -80,6 +83,8 @@
  * 

For example, to set the total timeout of getBatch to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * BatchControllerStubSettings.Builder batchControllerSettingsBuilder =
  *     BatchControllerStubSettings.newBuilder();
  * batchControllerSettingsBuilder
@@ -188,13 +193,17 @@ public UnaryCallSettings deleteBatchSettings() {
     return deleteBatchSettings;
   }
 
-  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public BatchControllerStub createStub() throws IOException {
     if (getTransportChannelProvider()
         .getTransportName()
         .equals(GrpcTransportChannel.getGrpcTransportName())) {
       return GrpcBatchControllerStub.create(this);
     }
+    if (getTransportChannelProvider()
+        .getTransportName()
+        .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+      return HttpJsonBatchControllerStub.create(this);
+    }
     throw new UnsupportedOperationException(
         String.format(
             "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -227,18 +236,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
         .setUseJwtAccessWithScope(true);
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return InstantiatingGrpcChannelProvider.newBuilder()
         .setMaxInboundMessageSize(Integer.MAX_VALUE);
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return InstantiatingHttpJsonChannelProvider.newBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return defaultGrpcTransportProviderBuilder().build();
   }
 
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
-  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+  public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken(
             "gapic", GaxProperties.getLibraryVersion(BatchControllerStubSettings.class))
@@ -246,11 +262,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
             GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
   }
 
-  /** Returns a new builder for this class. */
+  @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+  public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+    return ApiClientHeaderProvider.newBuilder()
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(BatchControllerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
+  }
+
+  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+    return BatchControllerStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+  }
+
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -348,6 +383,19 @@ private static Builder createDefault() {
       return initDefaults(builder);
     }
 
+    private static Builder createHttpJsonDefault() {
+      Builder builder = new Builder(((ClientContext) null));
+
+      builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+      builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+      builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+      builder.setEndpoint(getDefaultEndpoint());
+      builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+      builder.setSwitchToMtlsEndpointAllowed(true);
+
+      return initDefaults(builder);
+    }
+
     private static Builder initDefaults(Builder builder) {
       builder
           .createBatchSettings()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
index 2cae1ff5b8b0..ba43eba85ce0 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,11 @@
 public abstract class ClusterControllerStub implements BackgroundResource {
 
   public OperationsStub getOperationsStub() {
-    throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+    return null;
+  }
+
+  public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+    return null;
   }
 
   public OperationCallable
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
index 48194eb46627..766ba6112ca6 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStubSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,9 @@
 import com.google.api.gax.grpc.GrpcTransportChannel;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
 import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.longrunning.OperationSnapshot;
 import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
 import com.google.api.gax.retrying.RetrySettings;
@@ -85,6 +88,8 @@
  * 

For example, to set the total timeout of getCluster to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * ClusterControllerStubSettings.Builder clusterControllerSettingsBuilder =
  *     ClusterControllerStubSettings.newBuilder();
  * clusterControllerSettingsBuilder
@@ -261,13 +266,17 @@ public UnaryCallSettings diagnoseClusterSetti
     return diagnoseClusterOperationSettings;
   }
 
-  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ClusterControllerStub createStub() throws IOException {
     if (getTransportChannelProvider()
         .getTransportName()
         .equals(GrpcTransportChannel.getGrpcTransportName())) {
       return GrpcClusterControllerStub.create(this);
     }
+    if (getTransportChannelProvider()
+        .getTransportName()
+        .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+      return HttpJsonClusterControllerStub.create(this);
+    }
     throw new UnsupportedOperationException(
         String.format(
             "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -300,18 +309,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
         .setUseJwtAccessWithScope(true);
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return InstantiatingGrpcChannelProvider.newBuilder()
         .setMaxInboundMessageSize(Integer.MAX_VALUE);
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return InstantiatingHttpJsonChannelProvider.newBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return defaultGrpcTransportProviderBuilder().build();
   }
 
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
-  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+  public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken(
             "gapic", GaxProperties.getLibraryVersion(ClusterControllerStubSettings.class))
@@ -319,11 +335,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
             GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
   }
 
-  /** Returns a new builder for this class. */
+  @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+  public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+    return ApiClientHeaderProvider.newBuilder()
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(ClusterControllerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
+  }
+
+  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+    return ClusterControllerStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+  }
+
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -515,6 +550,19 @@ private static Builder createDefault() {
       return initDefaults(builder);
     }
 
+    private static Builder createHttpJsonDefault() {
+      Builder builder = new Builder(((ClientContext) null));
+
+      builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+      builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+      builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+      builder.setEndpoint(getDefaultEndpoint());
+      builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+      builder.setSwitchToMtlsEndpointAllowed(true);
+
+      return initDefaults(builder);
+    }
+
     private static Builder initDefaults(Builder builder) {
       builder
           .createClusterSettings()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceCallableFactory.java
index 8bb76da35770..4d243b6fc050 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceCallableFactory.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceCallableFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
index 89dd2c6563df..1a8d03fa912e 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcAutoscalingPolicyServiceStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerCallableFactory.java
index 0a5ca6af23ce..143a1c2d2dfc 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerCallableFactory.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerCallableFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerStub.java
index c7b481b653b9..044146baa455 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcBatchControllerStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerCallableFactory.java
index 7e08bdaf07d3..e4649a750f1e 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerCallableFactory.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerCallableFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
index 7b9fb4cbfbd0..078395cc0c98 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcClusterControllerStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerCallableFactory.java
index 6c20d95ac05a..b28a67de2d2e 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerCallableFactory.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerCallableFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
index 4eb3b09fc49a..52b5ae898e1c 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcJobControllerStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceCallableFactory.java
index 5899556e7d48..0d576947474d 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceCallableFactory.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceCallableFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
index 405a7863507b..1efd3f9289ec 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/GrpcWorkflowTemplateServiceStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceCallableFactory.java
new file mode 100644
index 000000000000..760e1347742b
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceCallableFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the AutoscalingPolicyService service API.
+ *
+ * 

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAutoscalingPolicyServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceStub.java new file mode 100644 index 000000000000..ee4bb3b9b304 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonAutoscalingPolicyServiceStub.java @@ -0,0 +1,452 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import static com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient.ListAutoscalingPoliciesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; +import com.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; +import com.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; +import com.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AutoscalingPolicyService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAutoscalingPolicyServiceStub extends AutoscalingPolicyServiceStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createAutoscalingPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.AutoscalingPolicyService/CreateAutoscalingPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/regions/*}/autoscalingPolicies") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("policy", request.getPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AutoscalingPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateAutoscalingPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.AutoscalingPolicyService/UpdateAutoscalingPolicy") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "policy.name", request.getPolicy().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("policy", request.getPolicy())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AutoscalingPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getAutoscalingPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.AutoscalingPolicyService/GetAutoscalingPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/regions/*/autoscalingPolicies/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AutoscalingPolicy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListAutoscalingPoliciesRequest, ListAutoscalingPoliciesResponse> + listAutoscalingPoliciesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.AutoscalingPolicyService/ListAutoscalingPolicies") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/regions/*}/autoscalingPolicies") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListAutoscalingPoliciesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteAutoscalingPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.AutoscalingPolicyService/DeleteAutoscalingPolicy") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/regions/*/autoscalingPolicies/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createAutoscalingPolicyCallable; + private final UnaryCallable + updateAutoscalingPolicyCallable; + private final UnaryCallable + getAutoscalingPolicyCallable; + private final UnaryCallable + listAutoscalingPoliciesCallable; + private final UnaryCallable + listAutoscalingPoliciesPagedCallable; + private final UnaryCallable + deleteAutoscalingPolicyCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAutoscalingPolicyServiceStub create( + AutoscalingPolicyServiceStubSettings settings) throws IOException { + return new HttpJsonAutoscalingPolicyServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAutoscalingPolicyServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAutoscalingPolicyServiceStub( + AutoscalingPolicyServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAutoscalingPolicyServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAutoscalingPolicyServiceStub( + AutoscalingPolicyServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonAutoscalingPolicyServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAutoscalingPolicyServiceStub( + AutoscalingPolicyServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAutoscalingPolicyServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAutoscalingPolicyServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAutoscalingPolicyServiceStub( + AutoscalingPolicyServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings + createAutoscalingPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createAutoscalingPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateAutoscalingPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateAutoscalingPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getAutoscalingPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getAutoscalingPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listAutoscalingPoliciesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listAutoscalingPoliciesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteAutoscalingPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteAutoscalingPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createAutoscalingPolicyCallable = + callableFactory.createUnaryCallable( + createAutoscalingPolicyTransportSettings, + settings.createAutoscalingPolicySettings(), + clientContext); + this.updateAutoscalingPolicyCallable = + callableFactory.createUnaryCallable( + updateAutoscalingPolicyTransportSettings, + settings.updateAutoscalingPolicySettings(), + clientContext); + this.getAutoscalingPolicyCallable = + callableFactory.createUnaryCallable( + getAutoscalingPolicyTransportSettings, + settings.getAutoscalingPolicySettings(), + clientContext); + this.listAutoscalingPoliciesCallable = + callableFactory.createUnaryCallable( + listAutoscalingPoliciesTransportSettings, + settings.listAutoscalingPoliciesSettings(), + clientContext); + this.listAutoscalingPoliciesPagedCallable = + callableFactory.createPagedCallable( + listAutoscalingPoliciesTransportSettings, + settings.listAutoscalingPoliciesSettings(), + clientContext); + this.deleteAutoscalingPolicyCallable = + callableFactory.createUnaryCallable( + deleteAutoscalingPolicyTransportSettings, + settings.deleteAutoscalingPolicySettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createAutoscalingPolicyMethodDescriptor); + methodDescriptors.add(updateAutoscalingPolicyMethodDescriptor); + methodDescriptors.add(getAutoscalingPolicyMethodDescriptor); + methodDescriptors.add(listAutoscalingPoliciesMethodDescriptor); + methodDescriptors.add(deleteAutoscalingPolicyMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable + createAutoscalingPolicyCallable() { + return createAutoscalingPolicyCallable; + } + + @Override + public UnaryCallable + updateAutoscalingPolicyCallable() { + return updateAutoscalingPolicyCallable; + } + + @Override + public UnaryCallable + getAutoscalingPolicyCallable() { + return getAutoscalingPolicyCallable; + } + + @Override + public UnaryCallable + listAutoscalingPoliciesCallable() { + return listAutoscalingPoliciesCallable; + } + + @Override + public UnaryCallable + listAutoscalingPoliciesPagedCallable() { + return listAutoscalingPoliciesPagedCallable; + } + + @Override + public UnaryCallable deleteAutoscalingPolicyCallable() { + return deleteAutoscalingPolicyCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerCallableFactory.java new file mode 100644 index 000000000000..f994d2816bb0 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the BatchController service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonBatchControllerCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerStub.java new file mode 100644 index 000000000000..aa10538ccf49 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonBatchControllerStub.java @@ -0,0 +1,389 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchOperationMetadata; +import com.google.cloud.dataproc.v1.CreateBatchRequest; +import com.google.cloud.dataproc.v1.DeleteBatchRequest; +import com.google.cloud.dataproc.v1.GetBatchRequest; +import com.google.cloud.dataproc.v1.ListBatchesRequest; +import com.google.cloud.dataproc.v1.ListBatchesResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the BatchController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonBatchControllerStub extends BatchControllerStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Batch.getDescriptor()) + .add(BatchOperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createBatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.BatchController/CreateBatch") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/batches", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "batchId", request.getBatchId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("batch", request.getBatch())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateBatchRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor getBatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.BatchController/GetBatch") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/batches/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Batch.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listBatchesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.BatchController/ListBatches") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/batches", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListBatchesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteBatchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.BatchController/DeleteBatch") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/batches/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createBatchCallable; + private final OperationCallable + createBatchOperationCallable; + private final UnaryCallable getBatchCallable; + private final UnaryCallable listBatchesCallable; + private final UnaryCallable + listBatchesPagedCallable; + private final UnaryCallable deleteBatchCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonBatchControllerStub create(BatchControllerStubSettings settings) + throws IOException { + return new HttpJsonBatchControllerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonBatchControllerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonBatchControllerStub( + BatchControllerStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonBatchControllerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonBatchControllerStub( + BatchControllerStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonBatchControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonBatchControllerStub( + BatchControllerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonBatchControllerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonBatchControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonBatchControllerStub( + BatchControllerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createBatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getBatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listBatchesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBatchesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteBatchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBatchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createBatchCallable = + callableFactory.createUnaryCallable( + createBatchTransportSettings, settings.createBatchSettings(), clientContext); + this.createBatchOperationCallable = + callableFactory.createOperationCallable( + createBatchTransportSettings, + settings.createBatchOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getBatchCallable = + callableFactory.createUnaryCallable( + getBatchTransportSettings, settings.getBatchSettings(), clientContext); + this.listBatchesCallable = + callableFactory.createUnaryCallable( + listBatchesTransportSettings, settings.listBatchesSettings(), clientContext); + this.listBatchesPagedCallable = + callableFactory.createPagedCallable( + listBatchesTransportSettings, settings.listBatchesSettings(), clientContext); + this.deleteBatchCallable = + callableFactory.createUnaryCallable( + deleteBatchTransportSettings, settings.deleteBatchSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createBatchMethodDescriptor); + methodDescriptors.add(getBatchMethodDescriptor); + methodDescriptors.add(listBatchesMethodDescriptor); + methodDescriptors.add(deleteBatchMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createBatchCallable() { + return createBatchCallable; + } + + @Override + public OperationCallable + createBatchOperationCallable() { + return createBatchOperationCallable; + } + + @Override + public UnaryCallable getBatchCallable() { + return getBatchCallable; + } + + @Override + public UnaryCallable listBatchesCallable() { + return listBatchesCallable; + } + + @Override + public UnaryCallable listBatchesPagedCallable() { + return listBatchesPagedCallable; + } + + @Override + public UnaryCallable deleteBatchCallable() { + return deleteBatchCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerCallableFactory.java new file mode 100644 index 000000000000..d3a8a4a6de24 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the ClusterController service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonClusterControllerCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerStub.java new file mode 100644 index 000000000000..e877794f983d --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonClusterControllerStub.java @@ -0,0 +1,739 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import static com.google.cloud.dataproc.v1.ClusterControllerClient.ListClustersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.CreateClusterRequest; +import com.google.cloud.dataproc.v1.DeleteClusterRequest; +import com.google.cloud.dataproc.v1.DiagnoseClusterRequest; +import com.google.cloud.dataproc.v1.DiagnoseClusterResults; +import com.google.cloud.dataproc.v1.GetClusterRequest; +import com.google.cloud.dataproc.v1.ListClustersRequest; +import com.google.cloud.dataproc.v1.ListClustersResponse; +import com.google.cloud.dataproc.v1.StartClusterRequest; +import com.google.cloud.dataproc.v1.StopClusterRequest; +import com.google.cloud.dataproc.v1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the ClusterController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonClusterControllerStub extends ClusterControllerStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(ClusterOperationMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .add(Cluster.getDescriptor()) + .add(DiagnoseClusterResults.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/CreateCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "actionOnFailedPrimaryWorkers", + request.getActionOnFailedPrimaryWorkers()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("cluster", request.getCluster())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/UpdateCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, + "gracefulDecommissionTimeout", + request.getGracefulDecommissionTimeout()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("cluster", request.getCluster())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + stopClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/StopCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request + .toBuilder() + .clearClusterName() + .clearProjectId() + .clearRegion() + .build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StopClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + startClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/StartCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request + .toBuilder() + .clearClusterName() + .clearProjectId() + .clearRegion() + .build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (StartClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/DeleteCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "clusterUuid", request.getClusterUuid()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor getClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/GetCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Cluster.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/ListClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListClustersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + diagnoseClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.ClusterController/DiagnoseCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "clusterName", request.getClusterName()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request + .toBuilder() + .clearClusterName() + .clearProjectId() + .clearRegion() + .build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DiagnoseClusterRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + private final UnaryCallable updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable stopClusterCallable; + private final OperationCallable + stopClusterOperationCallable; + private final UnaryCallable startClusterCallable; + private final OperationCallable + startClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable + deleteClusterOperationCallable; + private final UnaryCallable getClusterCallable; + private final UnaryCallable listClustersCallable; + private final UnaryCallable + listClustersPagedCallable; + private final UnaryCallable diagnoseClusterCallable; + private final OperationCallable< + DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata> + diagnoseClusterOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonClusterControllerStub create(ClusterControllerStubSettings settings) + throws IOException { + return new HttpJsonClusterControllerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonClusterControllerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonClusterControllerStub( + ClusterControllerStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonClusterControllerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonClusterControllerStub( + ClusterControllerStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonClusterControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonClusterControllerStub( + ClusterControllerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonClusterControllerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonClusterControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonClusterControllerStub( + ClusterControllerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings stopClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(stopClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings startClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(startClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings diagnoseClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(diagnoseClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateClusterCallable = + callableFactory.createUnaryCallable( + updateClusterTransportSettings, settings.updateClusterSettings(), clientContext); + this.updateClusterOperationCallable = + callableFactory.createOperationCallable( + updateClusterTransportSettings, + settings.updateClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.stopClusterCallable = + callableFactory.createUnaryCallable( + stopClusterTransportSettings, settings.stopClusterSettings(), clientContext); + this.stopClusterOperationCallable = + callableFactory.createOperationCallable( + stopClusterTransportSettings, + settings.stopClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.startClusterCallable = + callableFactory.createUnaryCallable( + startClusterTransportSettings, settings.startClusterSettings(), clientContext); + this.startClusterOperationCallable = + callableFactory.createOperationCallable( + startClusterTransportSettings, + settings.startClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteClusterCallable = + callableFactory.createUnaryCallable( + deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext); + this.deleteClusterOperationCallable = + callableFactory.createOperationCallable( + deleteClusterTransportSettings, + settings.deleteClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getClusterCallable = + callableFactory.createUnaryCallable( + getClusterTransportSettings, settings.getClusterSettings(), clientContext); + this.listClustersCallable = + callableFactory.createUnaryCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.listClustersPagedCallable = + callableFactory.createPagedCallable( + listClustersTransportSettings, settings.listClustersSettings(), clientContext); + this.diagnoseClusterCallable = + callableFactory.createUnaryCallable( + diagnoseClusterTransportSettings, settings.diagnoseClusterSettings(), clientContext); + this.diagnoseClusterOperationCallable = + callableFactory.createOperationCallable( + diagnoseClusterTransportSettings, + settings.diagnoseClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createClusterMethodDescriptor); + methodDescriptors.add(updateClusterMethodDescriptor); + methodDescriptors.add(stopClusterMethodDescriptor); + methodDescriptors.add(startClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(getClusterMethodDescriptor); + methodDescriptors.add(listClustersMethodDescriptor); + methodDescriptors.add(diagnoseClusterMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable + createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @Override + public UnaryCallable updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable + updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable stopClusterCallable() { + return stopClusterCallable; + } + + @Override + public OperationCallable + stopClusterOperationCallable() { + return stopClusterOperationCallable; + } + + @Override + public UnaryCallable startClusterCallable() { + return startClusterCallable; + } + + @Override + public OperationCallable + startClusterOperationCallable() { + return startClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable + deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable getClusterCallable() { + return getClusterCallable; + } + + @Override + public UnaryCallable listClustersCallable() { + return listClustersCallable; + } + + @Override + public UnaryCallable listClustersPagedCallable() { + return listClustersPagedCallable; + } + + @Override + public UnaryCallable diagnoseClusterCallable() { + return diagnoseClusterCallable; + } + + @Override + public OperationCallable + diagnoseClusterOperationCallable() { + return diagnoseClusterOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerCallableFactory.java new file mode 100644 index 000000000000..720bec66ce7c --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the JobController service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonJobControllerCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerStub.java new file mode 100644 index 000000000000..ddd1893669e1 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonJobControllerStub.java @@ -0,0 +1,563 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import static com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.CancelJobRequest; +import com.google.cloud.dataproc.v1.DeleteJobRequest; +import com.google.cloud.dataproc.v1.GetJobRequest; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobMetadata; +import com.google.cloud.dataproc.v1.ListJobsRequest; +import com.google.cloud.dataproc.v1.ListJobsResponse; +import com.google.cloud.dataproc.v1.SubmitJobRequest; +import com.google.cloud.dataproc.v1.UpdateJobRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the JobController service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonJobControllerStub extends JobControllerStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder().add(JobMetadata.getDescriptor()).add(Job.getDescriptor()).build(); + + private static final ApiMethodDescriptor submitJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/SubmitJob") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs:submit", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", request.toBuilder().clearProjectId().clearRegion().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + submitJobAsOperationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/SubmitJobAsOperation") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs:submitAsOperation", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request.toBuilder().clearProjectId().clearRegion().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (SubmitJobRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor getJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/GetJob") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "jobId", request.getJobId()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listJobsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/ListJobs") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "clusterName", request.getClusterName()); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam( + fields, "jobStateMatcher", request.getJobStateMatcher()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListJobsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/UpdateJob") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "jobId", request.getJobId()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("job", request.getJob())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor cancelJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/CancelJob") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "jobId", request.getJobId()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "*", + request + .toBuilder() + .clearJobId() + .clearProjectId() + .clearRegion() + .build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Job.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteJobMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.dataproc.v1.JobController/DeleteJob") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/projects/{projectId}/regions/{region}/jobs/{jobId}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "jobId", request.getJobId()); + serializer.putPathParam(fields, "projectId", request.getProjectId()); + serializer.putPathParam(fields, "region", request.getRegion()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable submitJobCallable; + private final UnaryCallable submitJobAsOperationCallable; + private final OperationCallable + submitJobAsOperationOperationCallable; + private final UnaryCallable getJobCallable; + private final UnaryCallable listJobsCallable; + private final UnaryCallable listJobsPagedCallable; + private final UnaryCallable updateJobCallable; + private final UnaryCallable cancelJobCallable; + private final UnaryCallable deleteJobCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonJobControllerStub create(JobControllerStubSettings settings) + throws IOException { + return new HttpJsonJobControllerStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonJobControllerStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonJobControllerStub( + JobControllerStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonJobControllerStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonJobControllerStub( + JobControllerStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonJobControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonJobControllerStub( + JobControllerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonJobControllerCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonJobControllerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonJobControllerStub( + JobControllerStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings submitJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(submitJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings submitJobAsOperationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(submitJobAsOperationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listJobsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listJobsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings cancelJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(cancelJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteJobTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteJobMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.submitJobCallable = + callableFactory.createUnaryCallable( + submitJobTransportSettings, settings.submitJobSettings(), clientContext); + this.submitJobAsOperationCallable = + callableFactory.createUnaryCallable( + submitJobAsOperationTransportSettings, + settings.submitJobAsOperationSettings(), + clientContext); + this.submitJobAsOperationOperationCallable = + callableFactory.createOperationCallable( + submitJobAsOperationTransportSettings, + settings.submitJobAsOperationOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getJobCallable = + callableFactory.createUnaryCallable( + getJobTransportSettings, settings.getJobSettings(), clientContext); + this.listJobsCallable = + callableFactory.createUnaryCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.listJobsPagedCallable = + callableFactory.createPagedCallable( + listJobsTransportSettings, settings.listJobsSettings(), clientContext); + this.updateJobCallable = + callableFactory.createUnaryCallable( + updateJobTransportSettings, settings.updateJobSettings(), clientContext); + this.cancelJobCallable = + callableFactory.createUnaryCallable( + cancelJobTransportSettings, settings.cancelJobSettings(), clientContext); + this.deleteJobCallable = + callableFactory.createUnaryCallable( + deleteJobTransportSettings, settings.deleteJobSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(submitJobMethodDescriptor); + methodDescriptors.add(submitJobAsOperationMethodDescriptor); + methodDescriptors.add(getJobMethodDescriptor); + methodDescriptors.add(listJobsMethodDescriptor); + methodDescriptors.add(updateJobMethodDescriptor); + methodDescriptors.add(cancelJobMethodDescriptor); + methodDescriptors.add(deleteJobMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable submitJobCallable() { + return submitJobCallable; + } + + @Override + public UnaryCallable submitJobAsOperationCallable() { + return submitJobAsOperationCallable; + } + + @Override + public OperationCallable + submitJobAsOperationOperationCallable() { + return submitJobAsOperationOperationCallable; + } + + @Override + public UnaryCallable getJobCallable() { + return getJobCallable; + } + + @Override + public UnaryCallable listJobsCallable() { + return listJobsCallable; + } + + @Override + public UnaryCallable listJobsPagedCallable() { + return listJobsPagedCallable; + } + + @Override + public UnaryCallable updateJobCallable() { + return updateJobCallable; + } + + @Override + public UnaryCallable cancelJobCallable() { + return cancelJobCallable; + } + + @Override + public UnaryCallable deleteJobCallable() { + return deleteJobCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceCallableFactory.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceCallableFactory.java new file mode 100644 index 000000000000..868d15f29350 --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the WorkflowTemplateService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonWorkflowTemplateServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceStub.java new file mode 100644 index 000000000000..1e980390ea3f --- /dev/null +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/HttpJsonWorkflowTemplateServiceStub.java @@ -0,0 +1,626 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub; + +import static com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.GetWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; +import com.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowMetadata; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the WorkflowTemplateService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonWorkflowTemplateServiceStub extends WorkflowTemplateServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(WorkflowMetadata.getDescriptor()) + .add(Empty.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/CreateWorkflowTemplate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/workflowTemplates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/regions/*}/workflowTemplates") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("template", request.getTemplate())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(WorkflowTemplate.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/GetWorkflowTemplate") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/regions/*/workflowTemplates/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "version", request.getVersion()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(WorkflowTemplate.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + instantiateWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/InstantiateWorkflowTemplate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (InstantiateWorkflowTemplateRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + instantiateInlineWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/InstantiateInlineWorkflowTemplate") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter + .newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths( + "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer + serializer = ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("template", request.getTemplate())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (InstantiateInlineWorkflowTemplateRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/UpdateWorkflowTemplate") + .setHttpMethod("PUT") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "template.name", request.getTemplate().getName()); + return fields; + }) + .setAdditionalPaths( + "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("template", request.getTemplate())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(WorkflowTemplate.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListWorkflowTemplatesRequest, ListWorkflowTemplatesResponse> + listWorkflowTemplatesMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/ListWorkflowTemplates") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/workflowTemplates", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setAdditionalPaths("/v1/{parent=projects/*/regions/*}/workflowTemplates") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListWorkflowTemplatesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteWorkflowTemplateMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.dataproc.v1.WorkflowTemplateService/DeleteWorkflowTemplate") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setAdditionalPaths("/v1/{name=projects/*/regions/*/workflowTemplates/*}") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "version", request.getVersion()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable + createWorkflowTemplateCallable; + private final UnaryCallable + getWorkflowTemplateCallable; + private final UnaryCallable + instantiateWorkflowTemplateCallable; + private final OperationCallable + instantiateWorkflowTemplateOperationCallable; + private final UnaryCallable + instantiateInlineWorkflowTemplateCallable; + private final OperationCallable + instantiateInlineWorkflowTemplateOperationCallable; + private final UnaryCallable + updateWorkflowTemplateCallable; + private final UnaryCallable + listWorkflowTemplatesCallable; + private final UnaryCallable + listWorkflowTemplatesPagedCallable; + private final UnaryCallable deleteWorkflowTemplateCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonWorkflowTemplateServiceStub create( + WorkflowTemplateServiceStubSettings settings) throws IOException { + return new HttpJsonWorkflowTemplateServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonWorkflowTemplateServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonWorkflowTemplateServiceStub( + WorkflowTemplateServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonWorkflowTemplateServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonWorkflowTemplateServiceStub( + WorkflowTemplateServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonWorkflowTemplateServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonWorkflowTemplateServiceStub( + WorkflowTemplateServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonWorkflowTemplateServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonWorkflowTemplateServiceStub, using the given settings. This + * is protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonWorkflowTemplateServiceStub( + WorkflowTemplateServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + createWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + instantiateWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(instantiateWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + instantiateInlineWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(instantiateInlineWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + updateWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listWorkflowTemplatesTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listWorkflowTemplatesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteWorkflowTemplateTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkflowTemplateMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + createWorkflowTemplateTransportSettings, + settings.createWorkflowTemplateSettings(), + clientContext); + this.getWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + getWorkflowTemplateTransportSettings, + settings.getWorkflowTemplateSettings(), + clientContext); + this.instantiateWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + instantiateWorkflowTemplateTransportSettings, + settings.instantiateWorkflowTemplateSettings(), + clientContext); + this.instantiateWorkflowTemplateOperationCallable = + callableFactory.createOperationCallable( + instantiateWorkflowTemplateTransportSettings, + settings.instantiateWorkflowTemplateOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.instantiateInlineWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + instantiateInlineWorkflowTemplateTransportSettings, + settings.instantiateInlineWorkflowTemplateSettings(), + clientContext); + this.instantiateInlineWorkflowTemplateOperationCallable = + callableFactory.createOperationCallable( + instantiateInlineWorkflowTemplateTransportSettings, + settings.instantiateInlineWorkflowTemplateOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + updateWorkflowTemplateTransportSettings, + settings.updateWorkflowTemplateSettings(), + clientContext); + this.listWorkflowTemplatesCallable = + callableFactory.createUnaryCallable( + listWorkflowTemplatesTransportSettings, + settings.listWorkflowTemplatesSettings(), + clientContext); + this.listWorkflowTemplatesPagedCallable = + callableFactory.createPagedCallable( + listWorkflowTemplatesTransportSettings, + settings.listWorkflowTemplatesSettings(), + clientContext); + this.deleteWorkflowTemplateCallable = + callableFactory.createUnaryCallable( + deleteWorkflowTemplateTransportSettings, + settings.deleteWorkflowTemplateSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createWorkflowTemplateMethodDescriptor); + methodDescriptors.add(getWorkflowTemplateMethodDescriptor); + methodDescriptors.add(instantiateWorkflowTemplateMethodDescriptor); + methodDescriptors.add(instantiateInlineWorkflowTemplateMethodDescriptor); + methodDescriptors.add(updateWorkflowTemplateMethodDescriptor); + methodDescriptors.add(listWorkflowTemplatesMethodDescriptor); + methodDescriptors.add(deleteWorkflowTemplateMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable + createWorkflowTemplateCallable() { + return createWorkflowTemplateCallable; + } + + @Override + public UnaryCallable getWorkflowTemplateCallable() { + return getWorkflowTemplateCallable; + } + + @Override + public UnaryCallable + instantiateWorkflowTemplateCallable() { + return instantiateWorkflowTemplateCallable; + } + + @Override + public OperationCallable + instantiateWorkflowTemplateOperationCallable() { + return instantiateWorkflowTemplateOperationCallable; + } + + @Override + public UnaryCallable + instantiateInlineWorkflowTemplateCallable() { + return instantiateInlineWorkflowTemplateCallable; + } + + @Override + public OperationCallable + instantiateInlineWorkflowTemplateOperationCallable() { + return instantiateInlineWorkflowTemplateOperationCallable; + } + + @Override + public UnaryCallable + updateWorkflowTemplateCallable() { + return updateWorkflowTemplateCallable; + } + + @Override + public UnaryCallable + listWorkflowTemplatesCallable() { + return listWorkflowTemplatesCallable; + } + + @Override + public UnaryCallable + listWorkflowTemplatesPagedCallable() { + return listWorkflowTemplatesPagedCallable; + } + + @Override + public UnaryCallable deleteWorkflowTemplateCallable() { + return deleteWorkflowTemplateCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java index d3613add3589..eea914952028 100644 --- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,11 @@ public abstract class JobControllerStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable submitJobCallable() { diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java index cf723d6c84e3..3d8358420e8c 100644 --- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java +++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/JobControllerStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -82,6 +85,8 @@ *

For example, to set the total timeout of submitJob to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * JobControllerStubSettings.Builder jobControllerSettingsBuilder =
  *     JobControllerStubSettings.newBuilder();
  * jobControllerSettingsBuilder
@@ -207,13 +212,17 @@ public UnaryCallSettings deleteJobSettings() {
     return deleteJobSettings;
   }
 
-  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public JobControllerStub createStub() throws IOException {
     if (getTransportChannelProvider()
         .getTransportName()
         .equals(GrpcTransportChannel.getGrpcTransportName())) {
       return GrpcJobControllerStub.create(this);
     }
+    if (getTransportChannelProvider()
+        .getTransportName()
+        .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+      return HttpJsonJobControllerStub.create(this);
+    }
     throw new UnsupportedOperationException(
         String.format(
             "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -246,18 +255,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
         .setUseJwtAccessWithScope(true);
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return InstantiatingGrpcChannelProvider.newBuilder()
         .setMaxInboundMessageSize(Integer.MAX_VALUE);
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return InstantiatingHttpJsonChannelProvider.newBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return defaultGrpcTransportProviderBuilder().build();
   }
 
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
-  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+  public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken(
             "gapic", GaxProperties.getLibraryVersion(JobControllerStubSettings.class))
@@ -265,11 +281,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
             GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
   }
 
-  /** Returns a new builder for this class. */
+  @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+  public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+    return ApiClientHeaderProvider.newBuilder()
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(JobControllerStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
+  }
+
+  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+    return JobControllerStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+  }
+
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -423,6 +458,19 @@ private static Builder createDefault() {
       return initDefaults(builder);
     }
 
+    private static Builder createHttpJsonDefault() {
+      Builder builder = new Builder(((ClientContext) null));
+
+      builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+      builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+      builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+      builder.setEndpoint(getDefaultEndpoint());
+      builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+      builder.setSwitchToMtlsEndpointAllowed(true);
+
+      return initDefaults(builder);
+    }
+
     private static Builder initDefaults(Builder builder) {
       builder
           .submitJobSettings()
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
index ea75946b662c..364a75b80e33 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStub.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,7 +46,11 @@
 public abstract class WorkflowTemplateServiceStub implements BackgroundResource {
 
   public OperationsStub getOperationsStub() {
-    throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+    return null;
+  }
+
+  public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+    return null;
   }
 
   public UnaryCallable
diff --git a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
index cc3a5f7e0ada..06fc771117b0 100644
--- a/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
+++ b/java-dataproc/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/WorkflowTemplateServiceStubSettings.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,6 +28,9 @@
 import com.google.api.gax.grpc.GrpcTransportChannel;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
 import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
 import com.google.api.gax.longrunning.OperationSnapshot;
 import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
 import com.google.api.gax.retrying.RetrySettings;
@@ -83,6 +86,8 @@
  * 

For example, to set the total timeout of createWorkflowTemplate to 30 seconds: * *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
  * WorkflowTemplateServiceStubSettings.Builder workflowTemplateServiceSettingsBuilder =
  *     WorkflowTemplateServiceStubSettings.newBuilder();
  * workflowTemplateServiceSettingsBuilder
@@ -249,13 +254,17 @@ public UnaryCallSettings deleteWorkflowTem
     return deleteWorkflowTemplateSettings;
   }
 
-  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public WorkflowTemplateServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
         .getTransportName()
         .equals(GrpcTransportChannel.getGrpcTransportName())) {
       return GrpcWorkflowTemplateServiceStub.create(this);
     }
+    if (getTransportChannelProvider()
+        .getTransportName()
+        .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+      return HttpJsonWorkflowTemplateServiceStub.create(this);
+    }
     throw new UnsupportedOperationException(
         String.format(
             "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
@@ -288,18 +297,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
         .setUseJwtAccessWithScope(true);
   }
 
-  /** Returns a builder for the default ChannelProvider for this service. */
+  /** Returns a builder for the default gRPC ChannelProvider for this service. */
   public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
     return InstantiatingGrpcChannelProvider.newBuilder()
         .setMaxInboundMessageSize(Integer.MAX_VALUE);
   }
 
+  /** Returns a builder for the default REST ChannelProvider for this service. */
+  @BetaApi
+  public static InstantiatingHttpJsonChannelProvider.Builder
+      defaultHttpJsonTransportProviderBuilder() {
+    return InstantiatingHttpJsonChannelProvider.newBuilder();
+  }
+
   public static TransportChannelProvider defaultTransportChannelProvider() {
     return defaultGrpcTransportProviderBuilder().build();
   }
 
   @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
-  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+  public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
     return ApiClientHeaderProvider.newBuilder()
         .setGeneratedLibToken(
             "gapic", GaxProperties.getLibraryVersion(WorkflowTemplateServiceStubSettings.class))
@@ -307,11 +323,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil
             GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
   }
 
-  /** Returns a new builder for this class. */
+  @BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
+  public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+    return ApiClientHeaderProvider.newBuilder()
+        .setGeneratedLibToken(
+            "gapic", GaxProperties.getLibraryVersion(WorkflowTemplateServiceStubSettings.class))
+        .setTransportToken(
+            GaxHttpJsonProperties.getHttpJsonTokenName(),
+            GaxHttpJsonProperties.getHttpJsonVersion());
+  }
+
+  public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+    return WorkflowTemplateServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+  }
+
+  /** Returns a new gRPC builder for this class. */
   public static Builder newBuilder() {
     return Builder.createDefault();
   }
 
+  /** Returns a new REST builder for this class. */
+  public static Builder newHttpJsonBuilder() {
+    return Builder.createHttpJsonDefault();
+  }
+
   /** Returns a new builder for this class. */
   public static Builder newBuilder(ClientContext clientContext) {
     return new Builder(clientContext);
@@ -487,6 +522,19 @@ private static Builder createDefault() {
       return initDefaults(builder);
     }
 
+    private static Builder createHttpJsonDefault() {
+      Builder builder = new Builder(((ClientContext) null));
+
+      builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+      builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+      builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+      builder.setEndpoint(getDefaultEndpoint());
+      builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+      builder.setSwitchToMtlsEndpointAllowed(true);
+
+      return initDefaults(builder);
+    }
+
     private static Builder initDefaults(Builder builder) {
       builder
           .createWorkflowTemplateSettings()
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientHttpJsonTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientHttpJsonTest.java
new file mode 100644
index 000000000000..318c4985f0d0
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientHttpJsonTest.java
@@ -0,0 +1,653 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1;
+
+import static com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient.ListAutoscalingPoliciesPagedResponse;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import com.google.cloud.dataproc.v1.stub.HttpJsonAutoscalingPolicyServiceStub;
+import com.google.common.collect.Lists;
+import com.google.protobuf.Empty;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import javax.annotation.Generated;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@Generated("by gapic-generator-java")
+public class AutoscalingPolicyServiceClientHttpJsonTest {
+  private static MockHttpService mockService;
+  private static AutoscalingPolicyServiceClient client;
+
+  @BeforeClass
+  public static void startStaticServer() throws IOException {
+    mockService =
+        new MockHttpService(
+            HttpJsonAutoscalingPolicyServiceStub.getMethodDescriptors(),
+            AutoscalingPolicyServiceSettings.getDefaultEndpoint());
+    AutoscalingPolicyServiceSettings settings =
+        AutoscalingPolicyServiceSettings.newHttpJsonBuilder()
+            .setTransportChannelProvider(
+                AutoscalingPolicyServiceSettings.defaultHttpJsonTransportProviderBuilder()
+                    .setHttpTransport(mockService)
+                    .build())
+            .setCredentialsProvider(NoCredentialsProvider.create())
+            .build();
+    client = AutoscalingPolicyServiceClient.create(settings);
+  }
+
+  @AfterClass
+  public static void stopServer() {
+    client.close();
+  }
+
+  @Before
+  public void setUp() {}
+
+  @After
+  public void tearDown() throws Exception {
+    mockService.reset();
+  }
+
+  @Test
+  public void createAutoscalingPolicyTest() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+    AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+
+    AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createAutoscalingPolicyExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+      client.createAutoscalingPolicy(parent, policy);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void createAutoscalingPolicyTest2() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+    AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+
+    AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createAutoscalingPolicyExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+      AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+      client.createAutoscalingPolicy(parent, policy);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void createAutoscalingPolicyTest3() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String parent = "projects/project-5833/locations/location-5833";
+    AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+
+    AutoscalingPolicy actualResponse = client.createAutoscalingPolicy(parent, policy);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createAutoscalingPolicyExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+      client.createAutoscalingPolicy(parent, policy);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void updateAutoscalingPolicyTest() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    AutoscalingPolicy policy =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+
+    AutoscalingPolicy actualResponse = client.updateAutoscalingPolicy(policy);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void updateAutoscalingPolicyExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      AutoscalingPolicy policy =
+          AutoscalingPolicy.newBuilder()
+              .setId("id3355")
+              .setName(
+                  AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                          "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                      .toString())
+              .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+              .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+              .putAllLabels(new HashMap())
+              .build();
+      client.updateAutoscalingPolicy(policy);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void getAutoscalingPolicyTest() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    AutoscalingPolicyName name =
+        AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+            "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+
+    AutoscalingPolicy actualResponse = client.getAutoscalingPolicy(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getAutoscalingPolicyExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      AutoscalingPolicyName name =
+          AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+              "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+      client.getAutoscalingPolicy(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void getAutoscalingPolicyTest2() throws Exception {
+    AutoscalingPolicy expectedResponse =
+        AutoscalingPolicy.newBuilder()
+            .setId("id3355")
+            .setName(
+                AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+                        "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]")
+                    .toString())
+            .setWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .setSecondaryWorkerConfig(InstanceGroupAutoscalingPolicyConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String name =
+        "projects/project-4686/locations/location-4686/autoscalingPolicies/autoscalingPolicie-4686";
+
+    AutoscalingPolicy actualResponse = client.getAutoscalingPolicy(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getAutoscalingPolicyExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-4686/locations/location-4686/autoscalingPolicies/autoscalingPolicie-4686";
+      client.getAutoscalingPolicy(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listAutoscalingPoliciesTest() throws Exception {
+    AutoscalingPolicy responsesElement = AutoscalingPolicy.newBuilder().build();
+    ListAutoscalingPoliciesResponse expectedResponse =
+        ListAutoscalingPoliciesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllPolicies(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+
+    ListAutoscalingPoliciesPagedResponse pagedListResponse = client.listAutoscalingPolicies(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listAutoscalingPoliciesExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      client.listAutoscalingPolicies(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listAutoscalingPoliciesTest2() throws Exception {
+    AutoscalingPolicy responsesElement = AutoscalingPolicy.newBuilder().build();
+    ListAutoscalingPoliciesResponse expectedResponse =
+        ListAutoscalingPoliciesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllPolicies(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+
+    ListAutoscalingPoliciesPagedResponse pagedListResponse = client.listAutoscalingPolicies(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listAutoscalingPoliciesExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+      client.listAutoscalingPolicies(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listAutoscalingPoliciesTest3() throws Exception {
+    AutoscalingPolicy responsesElement = AutoscalingPolicy.newBuilder().build();
+    ListAutoscalingPoliciesResponse expectedResponse =
+        ListAutoscalingPoliciesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllPolicies(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String parent = "projects/project-5833/locations/location-5833";
+
+    ListAutoscalingPoliciesPagedResponse pagedListResponse = client.listAutoscalingPolicies(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getPoliciesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listAutoscalingPoliciesExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      client.listAutoscalingPolicies(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteAutoscalingPolicyTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    AutoscalingPolicyName name =
+        AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+            "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+
+    client.deleteAutoscalingPolicy(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteAutoscalingPolicyExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      AutoscalingPolicyName name =
+          AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName(
+              "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]");
+      client.deleteAutoscalingPolicy(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteAutoscalingPolicyTest2() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    String name =
+        "projects/project-4686/locations/location-4686/autoscalingPolicies/autoscalingPolicie-4686";
+
+    client.deleteAutoscalingPolicy(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteAutoscalingPolicyExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-4686/locations/location-4686/autoscalingPolicies/autoscalingPolicie-4686";
+      client.deleteAutoscalingPolicy(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+}
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java
index 000fcdf6132e..d95da3026f98 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClientTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientHttpJsonTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientHttpJsonTest.java
new file mode 100644
index 000000000000..277b7332b261
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientHttpJsonTest.java
@@ -0,0 +1,502 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1;
+
+import static com.google.cloud.dataproc.v1.BatchControllerClient.ListBatchesPagedResponse;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import com.google.cloud.dataproc.v1.stub.HttpJsonBatchControllerStub;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import com.google.protobuf.Timestamp;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Generated;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@Generated("by gapic-generator-java")
+public class BatchControllerClientHttpJsonTest {
+  private static MockHttpService mockService;
+  private static BatchControllerClient client;
+
+  @BeforeClass
+  public static void startStaticServer() throws IOException {
+    mockService =
+        new MockHttpService(
+            HttpJsonBatchControllerStub.getMethodDescriptors(),
+            BatchControllerSettings.getDefaultEndpoint());
+    BatchControllerSettings settings =
+        BatchControllerSettings.newHttpJsonBuilder()
+            .setTransportChannelProvider(
+                BatchControllerSettings.defaultHttpJsonTransportProviderBuilder()
+                    .setHttpTransport(mockService)
+                    .build())
+            .setCredentialsProvider(NoCredentialsProvider.create())
+            .build();
+    client = BatchControllerClient.create(settings);
+  }
+
+  @AfterClass
+  public static void stopServer() {
+    client.close();
+  }
+
+  @Before
+  public void setUp() {}
+
+  @After
+  public void tearDown() throws Exception {
+    mockService.reset();
+  }
+
+  @Test
+  public void createBatchTest() throws Exception {
+    Batch expectedResponse =
+        Batch.newBuilder()
+            .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString())
+            .setUuid("uuid3601339")
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setRuntimeInfo(RuntimeInfo.newBuilder().build())
+            .setStateMessage("stateMessage1128185398")
+            .setStateTime(Timestamp.newBuilder().build())
+            .setCreator("creator1028554796")
+            .putAllLabels(new HashMap())
+            .setRuntimeConfig(RuntimeConfig.newBuilder().build())
+            .setEnvironmentConfig(EnvironmentConfig.newBuilder().build())
+            .setOperation("operation1662702951")
+            .addAllStateHistory(new ArrayList())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("createBatchTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+    Batch batch = Batch.newBuilder().build();
+    String batchId = "batchId-331744779";
+
+    Batch actualResponse = client.createBatchAsync(parent, batch, batchId).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createBatchExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      Batch batch = Batch.newBuilder().build();
+      String batchId = "batchId-331744779";
+      client.createBatchAsync(parent, batch, batchId).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void createBatchTest2() throws Exception {
+    Batch expectedResponse =
+        Batch.newBuilder()
+            .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString())
+            .setUuid("uuid3601339")
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setRuntimeInfo(RuntimeInfo.newBuilder().build())
+            .setStateMessage("stateMessage1128185398")
+            .setStateTime(Timestamp.newBuilder().build())
+            .setCreator("creator1028554796")
+            .putAllLabels(new HashMap())
+            .setRuntimeConfig(RuntimeConfig.newBuilder().build())
+            .setEnvironmentConfig(EnvironmentConfig.newBuilder().build())
+            .setOperation("operation1662702951")
+            .addAllStateHistory(new ArrayList())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("createBatchTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String parent = "projects/project-5833/locations/location-5833";
+    Batch batch = Batch.newBuilder().build();
+    String batchId = "batchId-331744779";
+
+    Batch actualResponse = client.createBatchAsync(parent, batch, batchId).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createBatchExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      Batch batch = Batch.newBuilder().build();
+      String batchId = "batchId-331744779";
+      client.createBatchAsync(parent, batch, batchId).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void getBatchTest() throws Exception {
+    Batch expectedResponse =
+        Batch.newBuilder()
+            .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString())
+            .setUuid("uuid3601339")
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setRuntimeInfo(RuntimeInfo.newBuilder().build())
+            .setStateMessage("stateMessage1128185398")
+            .setStateTime(Timestamp.newBuilder().build())
+            .setCreator("creator1028554796")
+            .putAllLabels(new HashMap())
+            .setRuntimeConfig(RuntimeConfig.newBuilder().build())
+            .setEnvironmentConfig(EnvironmentConfig.newBuilder().build())
+            .setOperation("operation1662702951")
+            .addAllStateHistory(new ArrayList())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
+
+    Batch actualResponse = client.getBatch(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getBatchExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
+      client.getBatch(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void getBatchTest2() throws Exception {
+    Batch expectedResponse =
+        Batch.newBuilder()
+            .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString())
+            .setUuid("uuid3601339")
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setRuntimeInfo(RuntimeInfo.newBuilder().build())
+            .setStateMessage("stateMessage1128185398")
+            .setStateTime(Timestamp.newBuilder().build())
+            .setCreator("creator1028554796")
+            .putAllLabels(new HashMap())
+            .setRuntimeConfig(RuntimeConfig.newBuilder().build())
+            .setEnvironmentConfig(EnvironmentConfig.newBuilder().build())
+            .setOperation("operation1662702951")
+            .addAllStateHistory(new ArrayList())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String name = "projects/project-1682/locations/location-1682/batches/batche-1682";
+
+    Batch actualResponse = client.getBatch(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getBatchExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name = "projects/project-1682/locations/location-1682/batches/batche-1682";
+      client.getBatch(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listBatchesTest() throws Exception {
+    Batch responsesElement = Batch.newBuilder().build();
+    ListBatchesResponse expectedResponse =
+        ListBatchesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllBatches(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+
+    ListBatchesPagedResponse pagedListResponse = client.listBatches(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getBatchesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listBatchesExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      client.listBatches(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listBatchesTest2() throws Exception {
+    Batch responsesElement = Batch.newBuilder().build();
+    ListBatchesResponse expectedResponse =
+        ListBatchesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllBatches(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String parent = "projects/project-5833/locations/location-5833";
+
+    ListBatchesPagedResponse pagedListResponse = client.listBatches(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getBatchesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listBatchesExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      client.listBatches(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteBatchTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
+
+    client.deleteBatch(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteBatchExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]");
+      client.deleteBatch(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteBatchTest2() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    String name = "projects/project-1682/locations/location-1682/batches/batche-1682";
+
+    client.deleteBatch(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteBatchExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name = "projects/project-1682/locations/location-1682/batches/batche-1682";
+      client.deleteBatch(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+}
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientTest.java
index e8825b6f336f..842b662a5c95 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientTest.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/BatchControllerClientTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientHttpJsonTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientHttpJsonTest.java
new file mode 100644
index 000000000000..64b8eb3de9f1
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientHttpJsonTest.java
@@ -0,0 +1,616 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1;
+
+import static com.google.cloud.dataproc.v1.ClusterControllerClient.ListClustersPagedResponse;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import com.google.cloud.dataproc.v1.stub.HttpJsonClusterControllerStub;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Generated;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@Generated("by gapic-generator-java")
+public class ClusterControllerClientHttpJsonTest {
+  private static MockHttpService mockService;
+  private static ClusterControllerClient client;
+
+  @BeforeClass
+  public static void startStaticServer() throws IOException {
+    mockService =
+        new MockHttpService(
+            HttpJsonClusterControllerStub.getMethodDescriptors(),
+            ClusterControllerSettings.getDefaultEndpoint());
+    ClusterControllerSettings settings =
+        ClusterControllerSettings.newHttpJsonBuilder()
+            .setTransportChannelProvider(
+                ClusterControllerSettings.defaultHttpJsonTransportProviderBuilder()
+                    .setHttpTransport(mockService)
+                    .build())
+            .setCredentialsProvider(NoCredentialsProvider.create())
+            .build();
+    client = ClusterControllerClient.create(settings);
+  }
+
+  @AfterClass
+  public static void stopServer() {
+    client.close();
+  }
+
+  @Before
+  public void setUp() {}
+
+  @After
+  public void tearDown() throws Exception {
+    mockService.reset();
+  }
+
+  @Test
+  public void createClusterTest() throws Exception {
+    Cluster expectedResponse =
+        Cluster.newBuilder()
+            .setProjectId("projectId-894832108")
+            .setClusterName("clusterName-1141738587")
+            .setConfig(ClusterConfig.newBuilder().build())
+            .setVirtualClusterConfig(VirtualClusterConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setStatus(ClusterStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .setClusterUuid("clusterUuid-1141510955")
+            .setMetrics(ClusterMetrics.newBuilder().build())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("createClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    Cluster cluster = Cluster.newBuilder().build();
+
+    Cluster actualResponse = client.createClusterAsync(projectId, region, cluster).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      Cluster cluster = Cluster.newBuilder().build();
+      client.createClusterAsync(projectId, region, cluster).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void updateClusterTest() throws Exception {
+    Cluster expectedResponse =
+        Cluster.newBuilder()
+            .setProjectId("projectId-894832108")
+            .setClusterName("clusterName-1141738587")
+            .setConfig(ClusterConfig.newBuilder().build())
+            .setVirtualClusterConfig(VirtualClusterConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setStatus(ClusterStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .setClusterUuid("clusterUuid-1141510955")
+            .setMetrics(ClusterMetrics.newBuilder().build())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("updateClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String clusterName = "clusterName-7787";
+    Cluster cluster = Cluster.newBuilder().build();
+    FieldMask updateMask = FieldMask.newBuilder().build();
+
+    Cluster actualResponse =
+        client.updateClusterAsync(projectId, region, clusterName, cluster, updateMask).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void updateClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String clusterName = "clusterName-7787";
+      Cluster cluster = Cluster.newBuilder().build();
+      FieldMask updateMask = FieldMask.newBuilder().build();
+      client.updateClusterAsync(projectId, region, clusterName, cluster, updateMask).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void stopClusterTest() throws Exception {
+    Cluster expectedResponse =
+        Cluster.newBuilder()
+            .setProjectId("projectId-894832108")
+            .setClusterName("clusterName-1141738587")
+            .setConfig(ClusterConfig.newBuilder().build())
+            .setVirtualClusterConfig(VirtualClusterConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setStatus(ClusterStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .setClusterUuid("clusterUuid-1141510955")
+            .setMetrics(ClusterMetrics.newBuilder().build())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("stopClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    StopClusterRequest request =
+        StopClusterRequest.newBuilder()
+            .setProjectId("projectId-1530")
+            .setRegion("region-9622")
+            .setClusterName("clusterName-7787")
+            .setClusterUuid("clusterUuid-1141510955")
+            .setRequestId("requestId693933066")
+            .build();
+
+    Cluster actualResponse = client.stopClusterAsync(request).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void stopClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      StopClusterRequest request =
+          StopClusterRequest.newBuilder()
+              .setProjectId("projectId-1530")
+              .setRegion("region-9622")
+              .setClusterName("clusterName-7787")
+              .setClusterUuid("clusterUuid-1141510955")
+              .setRequestId("requestId693933066")
+              .build();
+      client.stopClusterAsync(request).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void startClusterTest() throws Exception {
+    Cluster expectedResponse =
+        Cluster.newBuilder()
+            .setProjectId("projectId-894832108")
+            .setClusterName("clusterName-1141738587")
+            .setConfig(ClusterConfig.newBuilder().build())
+            .setVirtualClusterConfig(VirtualClusterConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setStatus(ClusterStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .setClusterUuid("clusterUuid-1141510955")
+            .setMetrics(ClusterMetrics.newBuilder().build())
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("startClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    StartClusterRequest request =
+        StartClusterRequest.newBuilder()
+            .setProjectId("projectId-1530")
+            .setRegion("region-9622")
+            .setClusterName("clusterName-7787")
+            .setClusterUuid("clusterUuid-1141510955")
+            .setRequestId("requestId693933066")
+            .build();
+
+    Cluster actualResponse = client.startClusterAsync(request).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void startClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      StartClusterRequest request =
+          StartClusterRequest.newBuilder()
+              .setProjectId("projectId-1530")
+              .setRegion("region-9622")
+              .setClusterName("clusterName-7787")
+              .setClusterUuid("clusterUuid-1141510955")
+              .setRequestId("requestId693933066")
+              .build();
+      client.startClusterAsync(request).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void deleteClusterTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("deleteClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String clusterName = "clusterName-7787";
+
+    client.deleteClusterAsync(projectId, region, clusterName).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String clusterName = "clusterName-7787";
+      client.deleteClusterAsync(projectId, region, clusterName).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void getClusterTest() throws Exception {
+    Cluster expectedResponse =
+        Cluster.newBuilder()
+            .setProjectId("projectId-894832108")
+            .setClusterName("clusterName-1141738587")
+            .setConfig(ClusterConfig.newBuilder().build())
+            .setVirtualClusterConfig(VirtualClusterConfig.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setStatus(ClusterStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .setClusterUuid("clusterUuid-1141510955")
+            .setMetrics(ClusterMetrics.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String clusterName = "clusterName-7787";
+
+    Cluster actualResponse = client.getCluster(projectId, region, clusterName);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String clusterName = "clusterName-7787";
+      client.getCluster(projectId, region, clusterName);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listClustersTest() throws Exception {
+    Cluster responsesElement = Cluster.newBuilder().build();
+    ListClustersResponse expectedResponse =
+        ListClustersResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllClusters(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+
+    ListClustersPagedResponse pagedListResponse = client.listClusters(projectId, region);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listClustersExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      client.listClusters(projectId, region);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listClustersTest2() throws Exception {
+    Cluster responsesElement = Cluster.newBuilder().build();
+    ListClustersResponse expectedResponse =
+        ListClustersResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllClusters(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String filter = "filter-1274492040";
+
+    ListClustersPagedResponse pagedListResponse = client.listClusters(projectId, region, filter);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getClustersList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listClustersExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String filter = "filter-1274492040";
+      client.listClusters(projectId, region, filter);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void diagnoseClusterTest() throws Exception {
+    DiagnoseClusterResults expectedResponse =
+        DiagnoseClusterResults.newBuilder().setOutputUri("outputUri-2119300949").build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("diagnoseClusterTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String clusterName = "clusterName-7787";
+
+    DiagnoseClusterResults actualResponse =
+        client.diagnoseClusterAsync(projectId, region, clusterName).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void diagnoseClusterExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String clusterName = "clusterName-7787";
+      client.diagnoseClusterAsync(projectId, region, clusterName).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+}
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java
index b84fc4e397d0..74fb6df7008b 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/ClusterControllerClientTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientHttpJsonTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientHttpJsonTest.java
new file mode 100644
index 000000000000..0bcb2ad9211d
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientHttpJsonTest.java
@@ -0,0 +1,539 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1;
+
+import static com.google.cloud.dataproc.v1.JobControllerClient.ListJobsPagedResponse;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import com.google.cloud.dataproc.v1.stub.HttpJsonJobControllerStub;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Empty;
+import com.google.protobuf.FieldMask;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Generated;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@Generated("by gapic-generator-java")
+public class JobControllerClientHttpJsonTest {
+  private static MockHttpService mockService;
+  private static JobControllerClient client;
+
+  @BeforeClass
+  public static void startStaticServer() throws IOException {
+    mockService =
+        new MockHttpService(
+            HttpJsonJobControllerStub.getMethodDescriptors(),
+            JobControllerSettings.getDefaultEndpoint());
+    JobControllerSettings settings =
+        JobControllerSettings.newHttpJsonBuilder()
+            .setTransportChannelProvider(
+                JobControllerSettings.defaultHttpJsonTransportProviderBuilder()
+                    .setHttpTransport(mockService)
+                    .build())
+            .setCredentialsProvider(NoCredentialsProvider.create())
+            .build();
+    client = JobControllerClient.create(settings);
+  }
+
+  @AfterClass
+  public static void stopServer() {
+    client.close();
+  }
+
+  @Before
+  public void setUp() {}
+
+  @After
+  public void tearDown() throws Exception {
+    mockService.reset();
+  }
+
+  @Test
+  public void submitJobTest() throws Exception {
+    Job expectedResponse =
+        Job.newBuilder()
+            .setReference(JobReference.newBuilder().build())
+            .setPlacement(JobPlacement.newBuilder().build())
+            .setStatus(JobStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .addAllYarnApplications(new ArrayList())
+            .setDriverOutputResourceUri("driverOutputResourceUri794556277")
+            .setDriverControlFilesUri("driverControlFilesUri1491948202")
+            .putAllLabels(new HashMap())
+            .setScheduling(JobScheduling.newBuilder().build())
+            .setJobUuid("jobUuid-1437868776")
+            .setDone(true)
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    Job job = Job.newBuilder().build();
+
+    Job actualResponse = client.submitJob(projectId, region, job);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void submitJobExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      Job job = Job.newBuilder().build();
+      client.submitJob(projectId, region, job);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void submitJobAsOperationTest() throws Exception {
+    Job expectedResponse =
+        Job.newBuilder()
+            .setReference(JobReference.newBuilder().build())
+            .setPlacement(JobPlacement.newBuilder().build())
+            .setStatus(JobStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .addAllYarnApplications(new ArrayList())
+            .setDriverOutputResourceUri("driverOutputResourceUri794556277")
+            .setDriverControlFilesUri("driverControlFilesUri1491948202")
+            .putAllLabels(new HashMap())
+            .setScheduling(JobScheduling.newBuilder().build())
+            .setJobUuid("jobUuid-1437868776")
+            .setDone(true)
+            .build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("submitJobAsOperationTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    Job job = Job.newBuilder().build();
+
+    Job actualResponse = client.submitJobAsOperationAsync(projectId, region, job).get();
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void submitJobAsOperationExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      Job job = Job.newBuilder().build();
+      client.submitJobAsOperationAsync(projectId, region, job).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void getJobTest() throws Exception {
+    Job expectedResponse =
+        Job.newBuilder()
+            .setReference(JobReference.newBuilder().build())
+            .setPlacement(JobPlacement.newBuilder().build())
+            .setStatus(JobStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .addAllYarnApplications(new ArrayList())
+            .setDriverOutputResourceUri("driverOutputResourceUri794556277")
+            .setDriverControlFilesUri("driverControlFilesUri1491948202")
+            .putAllLabels(new HashMap())
+            .setScheduling(JobScheduling.newBuilder().build())
+            .setJobUuid("jobUuid-1437868776")
+            .setDone(true)
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String jobId = "jobId-3646";
+
+    Job actualResponse = client.getJob(projectId, region, jobId);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getJobExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String jobId = "jobId-3646";
+      client.getJob(projectId, region, jobId);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listJobsTest() throws Exception {
+    Job responsesElement = Job.newBuilder().build();
+    ListJobsResponse expectedResponse =
+        ListJobsResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllJobs(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+
+    ListJobsPagedResponse pagedListResponse = client.listJobs(projectId, region);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listJobsExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      client.listJobs(projectId, region);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listJobsTest2() throws Exception {
+    Job responsesElement = Job.newBuilder().build();
+    ListJobsResponse expectedResponse =
+        ListJobsResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllJobs(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String filter = "filter-1274492040";
+
+    ListJobsPagedResponse pagedListResponse = client.listJobs(projectId, region, filter);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getJobsList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listJobsExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String filter = "filter-1274492040";
+      client.listJobs(projectId, region, filter);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void updateJobTest() throws Exception {
+    Job expectedResponse =
+        Job.newBuilder()
+            .setReference(JobReference.newBuilder().build())
+            .setPlacement(JobPlacement.newBuilder().build())
+            .setStatus(JobStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .addAllYarnApplications(new ArrayList())
+            .setDriverOutputResourceUri("driverOutputResourceUri794556277")
+            .setDriverControlFilesUri("driverControlFilesUri1491948202")
+            .putAllLabels(new HashMap())
+            .setScheduling(JobScheduling.newBuilder().build())
+            .setJobUuid("jobUuid-1437868776")
+            .setDone(true)
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    UpdateJobRequest request =
+        UpdateJobRequest.newBuilder()
+            .setProjectId("projectId-1530")
+            .setRegion("region-9622")
+            .setJobId("jobId-3646")
+            .setJob(Job.newBuilder().build())
+            .setUpdateMask(FieldMask.newBuilder().build())
+            .build();
+
+    Job actualResponse = client.updateJob(request);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void updateJobExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      UpdateJobRequest request =
+          UpdateJobRequest.newBuilder()
+              .setProjectId("projectId-1530")
+              .setRegion("region-9622")
+              .setJobId("jobId-3646")
+              .setJob(Job.newBuilder().build())
+              .setUpdateMask(FieldMask.newBuilder().build())
+              .build();
+      client.updateJob(request);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void cancelJobTest() throws Exception {
+    Job expectedResponse =
+        Job.newBuilder()
+            .setReference(JobReference.newBuilder().build())
+            .setPlacement(JobPlacement.newBuilder().build())
+            .setStatus(JobStatus.newBuilder().build())
+            .addAllStatusHistory(new ArrayList())
+            .addAllYarnApplications(new ArrayList())
+            .setDriverOutputResourceUri("driverOutputResourceUri794556277")
+            .setDriverControlFilesUri("driverControlFilesUri1491948202")
+            .putAllLabels(new HashMap())
+            .setScheduling(JobScheduling.newBuilder().build())
+            .setJobUuid("jobUuid-1437868776")
+            .setDone(true)
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String jobId = "jobId-3646";
+
+    Job actualResponse = client.cancelJob(projectId, region, jobId);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void cancelJobExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String jobId = "jobId-3646";
+      client.cancelJob(projectId, region, jobId);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteJobTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    String projectId = "projectId-1530";
+    String region = "region-9622";
+    String jobId = "jobId-3646";
+
+    client.deleteJob(projectId, region, jobId);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteJobExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String projectId = "projectId-1530";
+      String region = "region-9622";
+      String jobId = "jobId-3646";
+      client.deleteJob(projectId, region, jobId);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+}
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java
index b23079124ada..ffa2b83b4e3a 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/JobControllerClientTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyService.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyService.java
index fbceec8b16a7..a5d46102841c 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyService.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyServiceImpl.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyServiceImpl.java
index 78357cb972e0..0352e3d7299e 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyServiceImpl.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockAutoscalingPolicyServiceImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchController.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchController.java
index 0d35efbd90c7..3df2af0e1e04 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchController.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchControllerImpl.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchControllerImpl.java
index ae3b2c9d4189..a2c9a1dae307 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchControllerImpl.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockBatchControllerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterController.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterController.java
index 757fb4cf1f8d..4023cc687589 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterController.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterControllerImpl.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterControllerImpl.java
index 90f5bdc336f2..fbf804c7f8bf 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterControllerImpl.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockClusterControllerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobController.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobController.java
index f585b65ed558..9b9096b1626b 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobController.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobControllerImpl.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobControllerImpl.java
index 682ba337ea48..e2cdd8b66f05 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobControllerImpl.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockJobControllerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateService.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateService.java
index f4881cc539c7..01061d84e73c 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateService.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateServiceImpl.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateServiceImpl.java
index 12761ffe70b6..b41de9738433 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateServiceImpl.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/MockWorkflowTemplateServiceImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientHttpJsonTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientHttpJsonTest.java
new file mode 100644
index 000000000000..147e97d96ce2
--- /dev/null
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientHttpJsonTest.java
@@ -0,0 +1,1037 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.dataproc.v1;
+
+import static com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient.ListWorkflowTemplatesPagedResponse;
+
+import com.google.api.gax.core.NoCredentialsProvider;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.testing.MockHttpService;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ApiException;
+import com.google.api.gax.rpc.ApiExceptionFactory;
+import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.gax.rpc.StatusCode;
+import com.google.api.gax.rpc.testing.FakeStatusCode;
+import com.google.cloud.dataproc.v1.stub.HttpJsonWorkflowTemplateServiceStub;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Any;
+import com.google.protobuf.Duration;
+import com.google.protobuf.Empty;
+import com.google.protobuf.Timestamp;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Generated;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+@Generated("by gapic-generator-java")
+public class WorkflowTemplateServiceClientHttpJsonTest {
+  private static MockHttpService mockService;
+  private static WorkflowTemplateServiceClient client;
+
+  @BeforeClass
+  public static void startStaticServer() throws IOException {
+    mockService =
+        new MockHttpService(
+            HttpJsonWorkflowTemplateServiceStub.getMethodDescriptors(),
+            WorkflowTemplateServiceSettings.getDefaultEndpoint());
+    WorkflowTemplateServiceSettings settings =
+        WorkflowTemplateServiceSettings.newHttpJsonBuilder()
+            .setTransportChannelProvider(
+                WorkflowTemplateServiceSettings.defaultHttpJsonTransportProviderBuilder()
+                    .setHttpTransport(mockService)
+                    .build())
+            .setCredentialsProvider(NoCredentialsProvider.create())
+            .build();
+    client = WorkflowTemplateServiceClient.create(settings);
+  }
+
+  @AfterClass
+  public static void stopServer() {
+    client.close();
+  }
+
+  @Before
+  public void setUp() {}
+
+  @After
+  public void tearDown() throws Exception {
+    mockService.reset();
+  }
+
+  @Test
+  public void createWorkflowTemplateTest() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.createWorkflowTemplate(parent, template);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void createWorkflowTemplateTest2() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createWorkflowTemplateExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.createWorkflowTemplate(parent, template);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void createWorkflowTemplateTest3() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String parent = "projects/project-5833/locations/location-5833";
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    WorkflowTemplate actualResponse = client.createWorkflowTemplate(parent, template);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void createWorkflowTemplateExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.createWorkflowTemplate(parent, template);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void getWorkflowTemplateTest() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    WorkflowTemplateName name =
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+
+    WorkflowTemplate actualResponse = client.getWorkflowTemplate(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      WorkflowTemplateName name =
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+      client.getWorkflowTemplate(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void getWorkflowTemplateTest2() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String name =
+        "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+
+    WorkflowTemplate actualResponse = client.getWorkflowTemplate(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void getWorkflowTemplateExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+      client.getWorkflowTemplate(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    WorkflowTemplateName name =
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+
+    client.instantiateWorkflowTemplateAsync(name).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      WorkflowTemplateName name =
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+      client.instantiateWorkflowTemplateAsync(name).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateTest2() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String name =
+        "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+
+    client.instantiateWorkflowTemplateAsync(name).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+      client.instantiateWorkflowTemplateAsync(name).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateTest3() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    WorkflowTemplateName name =
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+    Map parameters = new HashMap<>();
+
+    client.instantiateWorkflowTemplateAsync(name, parameters).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      WorkflowTemplateName name =
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+      Map parameters = new HashMap<>();
+      client.instantiateWorkflowTemplateAsync(name, parameters).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateTest4() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String name =
+        "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+    Map parameters = new HashMap<>();
+
+    client.instantiateWorkflowTemplateAsync(name, parameters).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateWorkflowTemplateExceptionTest4() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+      Map parameters = new HashMap<>();
+      client.instantiateWorkflowTemplateAsync(name, parameters).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateInlineWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateTest2() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateInlineWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateTest3() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    Operation resultOperation =
+        Operation.newBuilder()
+            .setName("instantiateInlineWorkflowTemplateTest")
+            .setDone(true)
+            .setResponse(Any.pack(expectedResponse))
+            .build();
+    mockService.addResponse(resultOperation);
+
+    String parent = "projects/project-5833/locations/location-5833";
+    WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+
+    client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void instantiateInlineWorkflowTemplateExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+      client.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+      Assert.fail("No exception raised");
+    } catch (ExecutionException e) {
+    }
+  }
+
+  @Test
+  public void updateWorkflowTemplateTest() throws Exception {
+    WorkflowTemplate expectedResponse =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    WorkflowTemplate template =
+        WorkflowTemplate.newBuilder()
+            .setId("id3355")
+            .setName(
+                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                    .toString())
+            .setVersion(351608024)
+            .setCreateTime(Timestamp.newBuilder().build())
+            .setUpdateTime(Timestamp.newBuilder().build())
+            .putAllLabels(new HashMap())
+            .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+            .addAllJobs(new ArrayList())
+            .addAllParameters(new ArrayList())
+            .setDagTimeout(Duration.newBuilder().build())
+            .build();
+
+    WorkflowTemplate actualResponse = client.updateWorkflowTemplate(template);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void updateWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      WorkflowTemplate template =
+          WorkflowTemplate.newBuilder()
+              .setId("id3355")
+              .setName(
+                  WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
+                          "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                      .toString())
+              .setVersion(351608024)
+              .setCreateTime(Timestamp.newBuilder().build())
+              .setUpdateTime(Timestamp.newBuilder().build())
+              .putAllLabels(new HashMap())
+              .setPlacement(WorkflowTemplatePlacement.newBuilder().build())
+              .addAllJobs(new ArrayList())
+              .addAllParameters(new ArrayList())
+              .setDagTimeout(Duration.newBuilder().build())
+              .build();
+      client.updateWorkflowTemplate(template);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listWorkflowTemplatesTest() throws Exception {
+    WorkflowTemplate responsesElement = WorkflowTemplate.newBuilder().build();
+    ListWorkflowTemplatesResponse expectedResponse =
+        ListWorkflowTemplatesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllTemplates(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+
+    ListWorkflowTemplatesPagedResponse pagedListResponse = client.listWorkflowTemplates(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getTemplatesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listWorkflowTemplatesExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+      client.listWorkflowTemplates(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listWorkflowTemplatesTest2() throws Exception {
+    WorkflowTemplate responsesElement = WorkflowTemplate.newBuilder().build();
+    ListWorkflowTemplatesResponse expectedResponse =
+        ListWorkflowTemplatesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllTemplates(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+
+    ListWorkflowTemplatesPagedResponse pagedListResponse = client.listWorkflowTemplates(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getTemplatesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listWorkflowTemplatesExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+      client.listWorkflowTemplates(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void listWorkflowTemplatesTest3() throws Exception {
+    WorkflowTemplate responsesElement = WorkflowTemplate.newBuilder().build();
+    ListWorkflowTemplatesResponse expectedResponse =
+        ListWorkflowTemplatesResponse.newBuilder()
+            .setNextPageToken("")
+            .addAllTemplates(Arrays.asList(responsesElement))
+            .build();
+    mockService.addResponse(expectedResponse);
+
+    String parent = "projects/project-5833/locations/location-5833";
+
+    ListWorkflowTemplatesPagedResponse pagedListResponse = client.listWorkflowTemplates(parent);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getTemplatesList().get(0), resources.get(0));
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void listWorkflowTemplatesExceptionTest3() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String parent = "projects/project-5833/locations/location-5833";
+      client.listWorkflowTemplates(parent);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteWorkflowTemplateTest() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    WorkflowTemplateName name =
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+
+    client.deleteWorkflowTemplate(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteWorkflowTemplateExceptionTest() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      WorkflowTemplateName name =
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
+      client.deleteWorkflowTemplate(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+
+  @Test
+  public void deleteWorkflowTemplateTest2() throws Exception {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockService.addResponse(expectedResponse);
+
+    String name =
+        "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+
+    client.deleteWorkflowTemplate(name);
+
+    List actualRequests = mockService.getRequestPaths();
+    Assert.assertEquals(1, actualRequests.size());
+
+    String apiClientHeaderKey =
+        mockService
+            .getRequestHeaders()
+            .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey())
+            .iterator()
+            .next();
+    Assert.assertTrue(
+        GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
+            .matcher(apiClientHeaderKey)
+            .matches());
+  }
+
+  @Test
+  public void deleteWorkflowTemplateExceptionTest2() throws Exception {
+    ApiException exception =
+        ApiExceptionFactory.createException(
+            new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false);
+    mockService.addException(exception);
+
+    try {
+      String name =
+          "projects/project-5104/locations/location-5104/workflowTemplates/workflowTemplate-5104";
+      client.deleteWorkflowTemplate(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception.
+    }
+  }
+}
diff --git a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
index 1fd5977bf2a1..6cb1712a138f 100644
--- a/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
+++ b/java-dataproc/google-cloud-dataproc/src/test/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClientTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -257,8 +257,8 @@ public void getWorkflowTemplateTest() throws Exception {
         WorkflowTemplate.newBuilder()
             .setId("id3355")
             .setName(
-                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
                     .toString())
             .setVersion(351608024)
             .setCreateTime(Timestamp.newBuilder().build())
@@ -272,8 +272,8 @@ public void getWorkflowTemplateTest() throws Exception {
     mockWorkflowTemplateService.addResponse(expectedResponse);
 
     WorkflowTemplateName name =
-        WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-            "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
 
     WorkflowTemplate actualResponse = client.getWorkflowTemplate(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -296,8 +296,8 @@ public void getWorkflowTemplateExceptionTest() throws Exception {
 
     try {
       WorkflowTemplateName name =
-          WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-              "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
       client.getWorkflowTemplate(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
@@ -311,8 +311,8 @@ public void getWorkflowTemplateTest2() throws Exception {
         WorkflowTemplate.newBuilder()
             .setId("id3355")
             .setName(
-                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
                     .toString())
             .setVersion(351608024)
             .setCreateTime(Timestamp.newBuilder().build())
@@ -367,8 +367,8 @@ public void instantiateWorkflowTemplateTest() throws Exception {
     mockWorkflowTemplateService.addResponse(resultOperation);
 
     WorkflowTemplateName name =
-        WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-            "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
 
     client.instantiateWorkflowTemplateAsync(name).get();
 
@@ -391,8 +391,8 @@ public void instantiateWorkflowTemplateExceptionTest() throws Exception {
 
     try {
       WorkflowTemplateName name =
-          WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-              "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
       client.instantiateWorkflowTemplateAsync(name).get();
       Assert.fail("No exception raised");
     } catch (ExecutionException e) {
@@ -457,8 +457,8 @@ public void instantiateWorkflowTemplateTest3() throws Exception {
     mockWorkflowTemplateService.addResponse(resultOperation);
 
     WorkflowTemplateName name =
-        WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-            "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
     Map parameters = new HashMap<>();
 
     client.instantiateWorkflowTemplateAsync(name, parameters).get();
@@ -483,8 +483,8 @@ public void instantiateWorkflowTemplateExceptionTest3() throws Exception {
 
     try {
       WorkflowTemplateName name =
-          WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-              "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
       Map parameters = new HashMap<>();
       client.instantiateWorkflowTemplateAsync(name, parameters).get();
       Assert.fail("No exception raised");
@@ -685,8 +685,8 @@ public void updateWorkflowTemplateTest() throws Exception {
         WorkflowTemplate.newBuilder()
             .setId("id3355")
             .setName(
-                WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-                        "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]")
+                WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+                        "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]")
                     .toString())
             .setVersion(351608024)
             .setCreateTime(Timestamp.newBuilder().build())
@@ -871,8 +871,8 @@ public void deleteWorkflowTemplateTest() throws Exception {
     mockWorkflowTemplateService.addResponse(expectedResponse);
 
     WorkflowTemplateName name =
-        WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-            "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+        WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+            "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
 
     client.deleteWorkflowTemplate(name);
 
@@ -895,8 +895,8 @@ public void deleteWorkflowTemplateExceptionTest() throws Exception {
 
     try {
       WorkflowTemplateName name =
-          WorkflowTemplateName.ofProjectRegionWorkflowTemplateName(
-              "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+          WorkflowTemplateName.ofProjectLocationWorkflowTemplateName(
+              "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]");
       client.deleteWorkflowTemplate(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfig.java
index 46edc5f09cc3..b3aebedd11a4 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AcceleratorConfig.java
@@ -95,6 +95,8 @@ private AcceleratorConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingConfig.java
index e86012695ceb..aea3e2cb516f 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingConfig.java
@@ -88,6 +88,8 @@ private AutoscalingConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
index 838b031989cf..524fac61042b 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPoliciesProto.java
@@ -103,81 +103,81 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "on}/autoscalingPolicies/{autoscaling_pol"
           + "icy}\022Lprojects/{project}/regions/{region"
           + "}/autoscalingPolicies/{autoscaling_polic"
-          + "y}B\013\n\talgorithm\"\244\001\n\031BasicAutoscalingAlgo"
-          + "rithm\022N\n\013yarn_config\030\001 \001(\01324.google.clou"
+          + "y}B\013\n\talgorithm\"\260\001\n\031BasicAutoscalingAlgo"
+          + "rithm\022P\n\013yarn_config\030\001 \001(\01324.google.clou"
           + "d.dataproc.v1.BasicYarnAutoscalingConfig"
-          + "B\003\340A\002\0227\n\017cooldown_period\030\002 \001(\0132\031.google."
-          + "protobuf.DurationB\003\340A\001\"\371\001\n\032BasicYarnAuto"
-          + "scalingConfig\022E\n\035graceful_decommission_t"
-          + "imeout\030\005 \001(\0132\031.google.protobuf.DurationB"
-          + "\003\340A\002\022\034\n\017scale_up_factor\030\001 \001(\001B\003\340A\002\022\036\n\021sc"
-          + "ale_down_factor\030\002 \001(\001B\003\340A\002\022)\n\034scale_up_m"
-          + "in_worker_fraction\030\003 \001(\001B\003\340A\001\022+\n\036scale_d"
-          + "own_min_worker_fraction\030\004 \001(\001B\003\340A\001\"s\n$In"
-          + "stanceGroupAutoscalingPolicyConfig\022\032\n\rmi"
-          + "n_instances\030\001 \001(\005B\003\340A\001\022\032\n\rmax_instances\030"
-          + "\002 \001(\005B\003\340A\002\022\023\n\006weight\030\003 \001(\005B\003\340A\001\"\245\001\n\036Crea"
-          + "teAutoscalingPolicyRequest\022A\n\006parent\030\001 \001"
-          + "(\tB1\340A\002\372A+\022)dataproc.googleapis.com/Auto"
-          + "scalingPolicy\022@\n\006policy\030\002 \001(\0132+.google.c"
-          + "loud.dataproc.v1.AutoscalingPolicyB\003\340A\002\""
-          + "^\n\033GetAutoscalingPolicyRequest\022?\n\004name\030\001"
-          + " \001(\tB1\340A\002\372A+\n)dataproc.googleapis.com/Au"
-          + "toscalingPolicy\"b\n\036UpdateAutoscalingPoli"
-          + "cyRequest\022@\n\006policy\030\001 \001(\0132+.google.cloud"
-          + ".dataproc.v1.AutoscalingPolicyB\003\340A\002\"a\n\036D"
-          + "eleteAutoscalingPolicyRequest\022?\n\004name\030\001 "
-          + "\001(\tB1\340A\002\372A+\n)dataproc.googleapis.com/Aut"
-          + "oscalingPolicy\"\224\001\n\036ListAutoscalingPolici"
-          + "esRequest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\022)datap"
-          + "roc.googleapis.com/AutoscalingPolicy\022\026\n\t"
-          + "page_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\t"
-          + "B\003\340A\001\"\203\001\n\037ListAutoscalingPoliciesRespons"
-          + "e\022B\n\010policies\030\001 \003(\0132+.google.cloud.datap"
-          + "roc.v1.AutoscalingPolicyB\003\340A\003\022\034\n\017next_pa"
-          + "ge_token\030\002 \001(\tB\003\340A\0032\256\013\n\030AutoscalingPolic"
-          + "yService\022\234\002\n\027CreateAutoscalingPolicy\0228.g"
-          + "oogle.cloud.dataproc.v1.CreateAutoscalin"
-          + "gPolicyRequest\032+.google.cloud.dataproc.v"
-          + "1.AutoscalingPolicy\"\231\001\202\323\344\223\002\202\001\"7/v1/{pare"
-          + "nt=projects/*/locations/*}/autoscalingPo"
-          + "licies:\006policyZ?\"5/v1/{parent=projects/*"
-          + "/regions/*}/autoscalingPolicies:\006policy\332"
-          + "A\rparent,policy\022\243\002\n\027UpdateAutoscalingPol"
-          + "icy\0228.google.cloud.dataproc.v1.UpdateAut"
-          + "oscalingPolicyRequest\032+.google.cloud.dat"
-          + "aproc.v1.AutoscalingPolicy\"\240\001\202\323\344\223\002\220\001\032>/v"
-          + "1/{policy.name=projects/*/locations/*/au"
-          + "toscalingPolicies/*}:\006policyZF\032/v1/{policy.name=projects/*/lo"
+          + "cations/*/autoscalingPolicies/*}:\006policy"
+          + "ZF\032 getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -626,7 +628,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -1483,8 +1485,9 @@ public Builder mergeBasicAlgorithm(
       } else {
         if (algorithmCase_ == 3) {
           basicAlgorithmBuilder_.mergeFrom(value);
+        } else {
+          basicAlgorithmBuilder_.setMessage(value);
         }
-        basicAlgorithmBuilder_.setMessage(value);
       }
       algorithmCase_ = 3;
       return this;
@@ -2029,7 +2032,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -2077,7 +2080,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2100,7 +2103,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -2130,7 +2133,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -2157,11 +2160,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyName.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyName.java
index b0b097193e5d..82c6ac7b6591 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyName.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyOrBuilder.java
index d859d06e5911..46ddc82ec653 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyOrBuilder.java
@@ -266,7 +266,12 @@ public interface AutoscalingPolicyOrBuilder
    *
    * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AuxiliaryServicesConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AuxiliaryServicesConfig.java
index 89635a5ba799..44a4a517adbd 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AuxiliaryServicesConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/AuxiliaryServicesConfig.java
@@ -112,6 +112,8 @@ private AuxiliaryServicesConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithm.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithm.java
index 16c497a7a78a..69de1a0f4e0c 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithm.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithm.java
@@ -71,18 +71,20 @@ private BasicAutoscalingAlgorithm(
           case 10:
             {
               com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder subBuilder = null;
-              if (yarnConfig_ != null) {
-                subBuilder = yarnConfig_.toBuilder();
+              if (configCase_ == 1) {
+                subBuilder =
+                    ((com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_).toBuilder();
               }
-              yarnConfig_ =
+              config_ =
                   input.readMessage(
                       com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.parser(),
                       extensionRegistry);
               if (subBuilder != null) {
-                subBuilder.mergeFrom(yarnConfig_);
-                yarnConfig_ = subBuilder.buildPartial();
+                subBuilder.mergeFrom(
+                    (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_);
+                config_ = subBuilder.buildPartial();
               }
-
+              configCase_ = 1;
               break;
             }
           case 18:
@@ -111,6 +113,8 @@ private BasicAutoscalingAlgorithm(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -134,8 +138,51 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
             com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.Builder.class);
   }
 
+  private int configCase_ = 0;
+  private java.lang.Object config_;
+
+  public enum ConfigCase
+      implements
+          com.google.protobuf.Internal.EnumLite,
+          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
+    YARN_CONFIG(1),
+    CONFIG_NOT_SET(0);
+    private final int value;
+
+    private ConfigCase(int value) {
+      this.value = value;
+    }
+    /**
+     * @param value The number of the enum to look for.
+     * @return The enum associated with the given number.
+     * @deprecated Use {@link #forNumber(int)} instead.
+     */
+    @java.lang.Deprecated
+    public static ConfigCase valueOf(int value) {
+      return forNumber(value);
+    }
+
+    public static ConfigCase forNumber(int value) {
+      switch (value) {
+        case 1:
+          return YARN_CONFIG;
+        case 0:
+          return CONFIG_NOT_SET;
+        default:
+          return null;
+      }
+    }
+
+    public int getNumber() {
+      return this.value;
+    }
+  };
+
+  public ConfigCase getConfigCase() {
+    return ConfigCase.forNumber(configCase_);
+  }
+
   public static final int YARN_CONFIG_FIELD_NUMBER = 1;
-  private com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig yarnConfig_;
   /**
    *
    *
@@ -151,7 +198,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    */
   @java.lang.Override
   public boolean hasYarnConfig() {
-    return yarnConfig_ != null;
+    return configCase_ == 1;
   }
   /**
    *
@@ -168,9 +215,10 @@ public boolean hasYarnConfig() {
    */
   @java.lang.Override
   public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig getYarnConfig() {
-    return yarnConfig_ == null
-        ? com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance()
-        : yarnConfig_;
+    if (configCase_ == 1) {
+      return (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_;
+    }
+    return com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
   }
   /**
    *
@@ -185,7 +233,10 @@ public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig getYarnConfig() {
    */
   @java.lang.Override
   public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigOrBuilder getYarnConfigOrBuilder() {
-    return getYarnConfig();
+    if (configCase_ == 1) {
+      return (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_;
+    }
+    return com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
   }
 
   public static final int COOLDOWN_PERIOD_FIELD_NUMBER = 2;
@@ -259,8 +310,8 @@ public final boolean isInitialized() {
 
   @java.lang.Override
   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
-    if (yarnConfig_ != null) {
-      output.writeMessage(1, getYarnConfig());
+    if (configCase_ == 1) {
+      output.writeMessage(1, (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_);
     }
     if (cooldownPeriod_ != null) {
       output.writeMessage(2, getCooldownPeriod());
@@ -274,8 +325,10 @@ public int getSerializedSize() {
     if (size != -1) return size;
 
     size = 0;
-    if (yarnConfig_ != null) {
-      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getYarnConfig());
+    if (configCase_ == 1) {
+      size +=
+          com.google.protobuf.CodedOutputStream.computeMessageSize(
+              1, (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_);
     }
     if (cooldownPeriod_ != null) {
       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCooldownPeriod());
@@ -296,14 +349,18 @@ public boolean equals(final java.lang.Object obj) {
     com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm other =
         (com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm) obj;
 
-    if (hasYarnConfig() != other.hasYarnConfig()) return false;
-    if (hasYarnConfig()) {
-      if (!getYarnConfig().equals(other.getYarnConfig())) return false;
-    }
     if (hasCooldownPeriod() != other.hasCooldownPeriod()) return false;
     if (hasCooldownPeriod()) {
       if (!getCooldownPeriod().equals(other.getCooldownPeriod())) return false;
     }
+    if (!getConfigCase().equals(other.getConfigCase())) return false;
+    switch (configCase_) {
+      case 1:
+        if (!getYarnConfig().equals(other.getYarnConfig())) return false;
+        break;
+      case 0:
+      default:
+    }
     if (!unknownFields.equals(other.unknownFields)) return false;
     return true;
   }
@@ -315,14 +372,18 @@ public int hashCode() {
     }
     int hash = 41;
     hash = (19 * hash) + getDescriptor().hashCode();
-    if (hasYarnConfig()) {
-      hash = (37 * hash) + YARN_CONFIG_FIELD_NUMBER;
-      hash = (53 * hash) + getYarnConfig().hashCode();
-    }
     if (hasCooldownPeriod()) {
       hash = (37 * hash) + COOLDOWN_PERIOD_FIELD_NUMBER;
       hash = (53 * hash) + getCooldownPeriod().hashCode();
     }
+    switch (configCase_) {
+      case 1:
+        hash = (37 * hash) + YARN_CONFIG_FIELD_NUMBER;
+        hash = (53 * hash) + getYarnConfig().hashCode();
+        break;
+      case 0:
+      default:
+    }
     hash = (29 * hash) + unknownFields.hashCode();
     memoizedHashCode = hash;
     return hash;
@@ -469,18 +530,14 @@ private void maybeForceBuilderInitialization() {
     @java.lang.Override
     public Builder clear() {
       super.clear();
-      if (yarnConfigBuilder_ == null) {
-        yarnConfig_ = null;
-      } else {
-        yarnConfig_ = null;
-        yarnConfigBuilder_ = null;
-      }
       if (cooldownPeriodBuilder_ == null) {
         cooldownPeriod_ = null;
       } else {
         cooldownPeriod_ = null;
         cooldownPeriodBuilder_ = null;
       }
+      configCase_ = 0;
+      config_ = null;
       return this;
     }
 
@@ -508,16 +565,19 @@ public com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm build() {
     public com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm buildPartial() {
       com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm result =
           new com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm(this);
-      if (yarnConfigBuilder_ == null) {
-        result.yarnConfig_ = yarnConfig_;
-      } else {
-        result.yarnConfig_ = yarnConfigBuilder_.build();
+      if (configCase_ == 1) {
+        if (yarnConfigBuilder_ == null) {
+          result.config_ = config_;
+        } else {
+          result.config_ = yarnConfigBuilder_.build();
+        }
       }
       if (cooldownPeriodBuilder_ == null) {
         result.cooldownPeriod_ = cooldownPeriod_;
       } else {
         result.cooldownPeriod_ = cooldownPeriodBuilder_.build();
       }
+      result.configCase_ = configCase_;
       onBuilt();
       return result;
     }
@@ -568,12 +628,20 @@ public Builder mergeFrom(com.google.protobuf.Message other) {
     public Builder mergeFrom(com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm other) {
       if (other == com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.getDefaultInstance())
         return this;
-      if (other.hasYarnConfig()) {
-        mergeYarnConfig(other.getYarnConfig());
-      }
       if (other.hasCooldownPeriod()) {
         mergeCooldownPeriod(other.getCooldownPeriod());
       }
+      switch (other.getConfigCase()) {
+        case YARN_CONFIG:
+          {
+            mergeYarnConfig(other.getYarnConfig());
+            break;
+          }
+        case CONFIG_NOT_SET:
+          {
+            break;
+          }
+      }
       this.mergeUnknownFields(other.unknownFields);
       onChanged();
       return this;
@@ -604,7 +672,20 @@ public Builder mergeFrom(
       return this;
     }
 
-    private com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig yarnConfig_;
+    private int configCase_ = 0;
+    private java.lang.Object config_;
+
+    public ConfigCase getConfigCase() {
+      return ConfigCase.forNumber(configCase_);
+    }
+
+    public Builder clearConfig() {
+      configCase_ = 0;
+      config_ = null;
+      onChanged();
+      return this;
+    }
+
     private com.google.protobuf.SingleFieldBuilderV3<
             com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig,
             com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder,
@@ -623,8 +704,9 @@ public Builder mergeFrom(
      *
      * @return Whether the yarnConfig field is set.
      */
+    @java.lang.Override
     public boolean hasYarnConfig() {
-      return yarnConfigBuilder_ != null || yarnConfig_ != null;
+      return configCase_ == 1;
     }
     /**
      *
@@ -639,13 +721,18 @@ public boolean hasYarnConfig() {
      *
      * @return The yarnConfig.
      */
+    @java.lang.Override
     public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig getYarnConfig() {
       if (yarnConfigBuilder_ == null) {
-        return yarnConfig_ == null
-            ? com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance()
-            : yarnConfig_;
+        if (configCase_ == 1) {
+          return (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_;
+        }
+        return com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
       } else {
-        return yarnConfigBuilder_.getMessage();
+        if (configCase_ == 1) {
+          return yarnConfigBuilder_.getMessage();
+        }
+        return com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
       }
     }
     /**
@@ -664,12 +751,12 @@ public Builder setYarnConfig(com.google.cloud.dataproc.v1.BasicYarnAutoscalingCo
         if (value == null) {
           throw new NullPointerException();
         }
-        yarnConfig_ = value;
+        config_ = value;
         onChanged();
       } else {
         yarnConfigBuilder_.setMessage(value);
       }
-
+      configCase_ = 1;
       return this;
     }
     /**
@@ -686,12 +773,12 @@ public Builder setYarnConfig(com.google.cloud.dataproc.v1.BasicYarnAutoscalingCo
     public Builder setYarnConfig(
         com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder builderForValue) {
       if (yarnConfigBuilder_ == null) {
-        yarnConfig_ = builderForValue.build();
+        config_ = builderForValue.build();
         onChanged();
       } else {
         yarnConfigBuilder_.setMessage(builderForValue.build());
       }
-
+      configCase_ = 1;
       return this;
     }
     /**
@@ -707,19 +794,26 @@ public Builder setYarnConfig(
      */
     public Builder mergeYarnConfig(com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig value) {
       if (yarnConfigBuilder_ == null) {
-        if (yarnConfig_ != null) {
-          yarnConfig_ =
-              com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.newBuilder(yarnConfig_)
+        if (configCase_ == 1
+            && config_
+                != com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance()) {
+          config_ =
+              com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.newBuilder(
+                      (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_)
                   .mergeFrom(value)
                   .buildPartial();
         } else {
-          yarnConfig_ = value;
+          config_ = value;
         }
         onChanged();
       } else {
-        yarnConfigBuilder_.mergeFrom(value);
+        if (configCase_ == 1) {
+          yarnConfigBuilder_.mergeFrom(value);
+        } else {
+          yarnConfigBuilder_.setMessage(value);
+        }
       }
-
+      configCase_ = 1;
       return this;
     }
     /**
@@ -735,13 +829,18 @@ public Builder mergeYarnConfig(com.google.cloud.dataproc.v1.BasicYarnAutoscaling
      */
     public Builder clearYarnConfig() {
       if (yarnConfigBuilder_ == null) {
-        yarnConfig_ = null;
-        onChanged();
+        if (configCase_ == 1) {
+          configCase_ = 0;
+          config_ = null;
+          onChanged();
+        }
       } else {
-        yarnConfig_ = null;
-        yarnConfigBuilder_ = null;
+        if (configCase_ == 1) {
+          configCase_ = 0;
+          config_ = null;
+        }
+        yarnConfigBuilder_.clear();
       }
-
       return this;
     }
     /**
@@ -756,8 +855,6 @@ public Builder clearYarnConfig() {
      * 
      */
     public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder getYarnConfigBuilder() {
-
-      onChanged();
       return getYarnConfigFieldBuilder().getBuilder();
     }
     /**
@@ -771,14 +868,16 @@ public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder getYarnCo
      * .google.cloud.dataproc.v1.BasicYarnAutoscalingConfig yarn_config = 1 [(.google.api.field_behavior) = REQUIRED];
      * 
      */
+    @java.lang.Override
     public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigOrBuilder
         getYarnConfigOrBuilder() {
-      if (yarnConfigBuilder_ != null) {
+      if ((configCase_ == 1) && (yarnConfigBuilder_ != null)) {
         return yarnConfigBuilder_.getMessageOrBuilder();
       } else {
-        return yarnConfig_ == null
-            ? com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance()
-            : yarnConfig_;
+        if (configCase_ == 1) {
+          return (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_;
+        }
+        return com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
       }
     }
     /**
@@ -798,14 +897,22 @@ public com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder getYarnCo
             com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigOrBuilder>
         getYarnConfigFieldBuilder() {
       if (yarnConfigBuilder_ == null) {
+        if (!(configCase_ == 1)) {
+          config_ = com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.getDefaultInstance();
+        }
         yarnConfigBuilder_ =
             new com.google.protobuf.SingleFieldBuilderV3<
                 com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig,
                 com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.Builder,
                 com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigOrBuilder>(
-                getYarnConfig(), getParentForChildren(), isClean());
-        yarnConfig_ = null;
+                (com.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) config_,
+                getParentForChildren(),
+                isClean());
+        config_ = null;
       }
+      configCase_ = 1;
+      onChanged();
+      ;
       return yarnConfigBuilder_;
     }
 
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithmOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithmOrBuilder.java
index f33fcf906f32..788c995b9b91 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithmOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicAutoscalingAlgorithmOrBuilder.java
@@ -107,4 +107,6 @@ public interface BasicAutoscalingAlgorithmOrBuilder
    * 
    */
   com.google.protobuf.DurationOrBuilder getCooldownPeriodOrBuilder();
+
+  public com.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.ConfigCase getConfigCase();
 }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicYarnAutoscalingConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicYarnAutoscalingConfig.java
index ec79cd0a171b..ec6246eeffc9 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicYarnAutoscalingConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BasicYarnAutoscalingConfig.java
@@ -114,6 +114,8 @@ private BasicYarnAutoscalingConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -316,16 +318,16 @@ public final boolean isInitialized() {
 
   @java.lang.Override
   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
-    if (scaleUpFactor_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleUpFactor_) != 0) {
       output.writeDouble(1, scaleUpFactor_);
     }
-    if (scaleDownFactor_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleDownFactor_) != 0) {
       output.writeDouble(2, scaleDownFactor_);
     }
-    if (scaleUpMinWorkerFraction_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleUpMinWorkerFraction_) != 0) {
       output.writeDouble(3, scaleUpMinWorkerFraction_);
     }
-    if (scaleDownMinWorkerFraction_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleDownMinWorkerFraction_) != 0) {
       output.writeDouble(4, scaleDownMinWorkerFraction_);
     }
     if (gracefulDecommissionTimeout_ != null) {
@@ -340,16 +342,16 @@ public int getSerializedSize() {
     if (size != -1) return size;
 
     size = 0;
-    if (scaleUpFactor_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleUpFactor_) != 0) {
       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, scaleUpFactor_);
     }
-    if (scaleDownFactor_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleDownFactor_) != 0) {
       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, scaleDownFactor_);
     }
-    if (scaleUpMinWorkerFraction_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleUpMinWorkerFraction_) != 0) {
       size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, scaleUpMinWorkerFraction_);
     }
-    if (scaleDownMinWorkerFraction_ != 0D) {
+    if (java.lang.Double.doubleToRawLongBits(scaleDownMinWorkerFraction_) != 0) {
       size +=
           com.google.protobuf.CodedOutputStream.computeDoubleSize(4, scaleDownMinWorkerFraction_);
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Batch.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Batch.java
index 569141131488..3ab9332cd41d 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Batch.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Batch.java
@@ -298,6 +298,8 @@ private Batch(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -773,6 +775,8 @@ private StateHistory(
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
         throw e.setUnfinishedMessage(this);
+      } catch (com.google.protobuf.UninitializedMessageException e) {
+        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
       } catch (java.io.IOException e) {
         throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
       } finally {
@@ -2482,7 +2486,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -2529,7 +2533,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2552,7 +2556,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -4109,8 +4113,9 @@ public Builder mergePysparkBatch(com.google.cloud.dataproc.v1.PySparkBatch value
       } else {
         if (batchConfigCase_ == 4) {
           pysparkBatchBuilder_.mergeFrom(value);
+        } else {
+          pysparkBatchBuilder_.setMessage(value);
         }
-        pysparkBatchBuilder_.setMessage(value);
       }
       batchConfigCase_ = 4;
       return this;
@@ -4335,8 +4340,9 @@ public Builder mergeSparkBatch(com.google.cloud.dataproc.v1.SparkBatch value) {
       } else {
         if (batchConfigCase_ == 5) {
           sparkBatchBuilder_.mergeFrom(value);
+        } else {
+          sparkBatchBuilder_.setMessage(value);
         }
-        sparkBatchBuilder_.setMessage(value);
       }
       batchConfigCase_ = 5;
       return this;
@@ -4562,8 +4568,9 @@ public Builder mergeSparkRBatch(com.google.cloud.dataproc.v1.SparkRBatch value)
       } else {
         if (batchConfigCase_ == 6) {
           sparkRBatchBuilder_.mergeFrom(value);
+        } else {
+          sparkRBatchBuilder_.setMessage(value);
         }
-        sparkRBatchBuilder_.setMessage(value);
       }
       batchConfigCase_ = 6;
       return this;
@@ -4789,8 +4796,9 @@ public Builder mergeSparkSqlBatch(com.google.cloud.dataproc.v1.SparkSqlBatch val
       } else {
         if (batchConfigCase_ == 7) {
           sparkSqlBatchBuilder_.mergeFrom(value);
+        } else {
+          sparkSqlBatchBuilder_.setMessage(value);
         }
-        sparkSqlBatchBuilder_.setMessage(value);
       }
       batchConfigCase_ = 7;
       return this;
@@ -5656,7 +5664,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -5704,7 +5712,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -5727,7 +5735,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -5757,7 +5765,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -5784,11 +5792,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchName.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchName.java
index cc26cad6b07c..0457babc54ed 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchName.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadata.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadata.java
index 9308ef78b7e5..0666d5651f06 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadata.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadata.java
@@ -167,6 +167,8 @@ private BatchOperationMetadata(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -661,7 +663,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -696,7 +698,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -713,7 +715,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -2105,7 +2107,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -2141,7 +2143,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2158,7 +2160,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -2182,7 +2184,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -2203,11 +2205,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadataOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadataOrBuilder.java
index f9f3a37798ed..0a1d94d08f22 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadataOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOperationMetadataOrBuilder.java
@@ -237,7 +237,12 @@ public interface BatchOperationMetadataOrBuilder
    *
    * map<string, string> labels = 8;
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOrBuilder.java
index c8c898ce42ef..1c5948fecc77 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/BatchOrBuilder.java
@@ -503,7 +503,12 @@ public interface BatchOrBuilder
    *
    * map<string, string> labels = 13 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CancelJobRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CancelJobRequest.java
index 01e1ca2def83..6be9129d1120 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CancelJobRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CancelJobRequest.java
@@ -104,6 +104,8 @@ private CancelJobRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Cluster.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Cluster.java
index 42993786f1c1..00afd40b93aa 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Cluster.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Cluster.java
@@ -197,6 +197,8 @@ private Cluster(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -510,7 +512,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -557,7 +559,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -580,7 +582,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -2134,7 +2136,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -2182,7 +2184,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2205,7 +2207,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -2235,7 +2237,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -2262,11 +2264,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfig.java
index 1d78a9f8e3e7..d2df6e2f262c 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterConfig.java
@@ -288,6 +288,8 @@ private ClusterConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterMetrics.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterMetrics.java
index 34679ea70235..f223cf44ee91 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterMetrics.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterMetrics.java
@@ -112,6 +112,8 @@ private ClusterMetrics(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -185,7 +187,7 @@ public int getHdfsMetricsCount() {
   @java.lang.Override
   public boolean containsHdfsMetrics(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetHdfsMetrics().getMap().containsKey(key);
   }
@@ -220,7 +222,7 @@ public java.util.Map getHdfsMetricsMap() {
   @java.lang.Override
   public long getHdfsMetricsOrDefault(java.lang.String key, long defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetHdfsMetrics().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -237,7 +239,7 @@ public long getHdfsMetricsOrDefault(java.lang.String key, long defaultValue) {
   @java.lang.Override
   public long getHdfsMetricsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetHdfsMetrics().getMap();
     if (!map.containsKey(key)) {
@@ -283,7 +285,7 @@ public int getYarnMetricsCount() {
   @java.lang.Override
   public boolean containsYarnMetrics(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetYarnMetrics().getMap().containsKey(key);
   }
@@ -318,7 +320,7 @@ public java.util.Map getYarnMetricsMap() {
   @java.lang.Override
   public long getYarnMetricsOrDefault(java.lang.String key, long defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetYarnMetrics().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -335,7 +337,7 @@ public long getYarnMetricsOrDefault(java.lang.String key, long defaultValue) {
   @java.lang.Override
   public long getYarnMetricsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetYarnMetrics().getMap();
     if (!map.containsKey(key)) {
@@ -755,7 +757,7 @@ public int getHdfsMetricsCount() {
     @java.lang.Override
     public boolean containsHdfsMetrics(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetHdfsMetrics().getMap().containsKey(key);
     }
@@ -790,7 +792,7 @@ public java.util.Map getHdfsMetricsMap() {
     @java.lang.Override
     public long getHdfsMetricsOrDefault(java.lang.String key, long defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetHdfsMetrics().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -807,7 +809,7 @@ public long getHdfsMetricsOrDefault(java.lang.String key, long defaultValue) {
     @java.lang.Override
     public long getHdfsMetricsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetHdfsMetrics().getMap();
       if (!map.containsKey(key)) {
@@ -831,7 +833,7 @@ public Builder clearHdfsMetrics() {
      */
     public Builder removeHdfsMetrics(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableHdfsMetrics().getMutableMap().remove(key);
       return this;
@@ -852,7 +854,7 @@ public java.util.Map getMutableHdfsMetrics() {
      */
     public Builder putHdfsMetrics(java.lang.String key, long value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
 
       internalGetMutableHdfsMetrics().getMutableMap().put(key, value);
@@ -912,7 +914,7 @@ public int getYarnMetricsCount() {
     @java.lang.Override
     public boolean containsYarnMetrics(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetYarnMetrics().getMap().containsKey(key);
     }
@@ -947,7 +949,7 @@ public java.util.Map getYarnMetricsMap() {
     @java.lang.Override
     public long getYarnMetricsOrDefault(java.lang.String key, long defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetYarnMetrics().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -964,7 +966,7 @@ public long getYarnMetricsOrDefault(java.lang.String key, long defaultValue) {
     @java.lang.Override
     public long getYarnMetricsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetYarnMetrics().getMap();
       if (!map.containsKey(key)) {
@@ -988,7 +990,7 @@ public Builder clearYarnMetrics() {
      */
     public Builder removeYarnMetrics(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableYarnMetrics().getMutableMap().remove(key);
       return this;
@@ -1009,7 +1011,7 @@ public java.util.Map getMutableYarnMetrics() {
      */
     public Builder putYarnMetrics(java.lang.String key, long value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
 
       internalGetMutableYarnMetrics().getMutableMap().put(key, value);
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperation.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperation.java
index 1fd830b12f40..4b2bad8fa5c0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperation.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperation.java
@@ -101,6 +101,8 @@ private ClusterOperation(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadata.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadata.java
index 4058f3051539..95a1cc885b98 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadata.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadata.java
@@ -168,6 +168,8 @@ private ClusterOperationMetadata(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -577,7 +579,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -614,7 +616,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -632,7 +634,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -2293,7 +2295,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -2331,7 +2333,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2349,7 +2351,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -2374,7 +2376,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -2396,11 +2398,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadataOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadataOrBuilder.java
index 686148596dd7..c9865b12c0e8 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadataOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationMetadataOrBuilder.java
@@ -272,7 +272,12 @@ public interface ClusterOperationMetadataOrBuilder
    * map<string, string> labels = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
    * 
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationStatus.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationStatus.java
index 51a4ad976dcc..d59a46f6e431 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationStatus.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOperationStatus.java
@@ -119,6 +119,8 @@ private ClusterOperationStatus(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOrBuilder.java
index 88fb3d88d42e..542813e6e31a 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterOrBuilder.java
@@ -247,7 +247,12 @@ public interface ClusterOrBuilder
    *
    * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelector.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelector.java
index 5b8cd7996e26..8e0426767bfb 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelector.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelector.java
@@ -106,6 +106,8 @@ private ClusterSelector(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -236,7 +238,7 @@ public int getClusterLabelsCount() {
   @java.lang.Override
   public boolean containsClusterLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetClusterLabels().getMap().containsKey(key);
   }
@@ -276,7 +278,7 @@ public java.util.Map getClusterLabelsMap() {
   public java.lang.String getClusterLabelsOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetClusterLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -295,7 +297,7 @@ public java.lang.String getClusterLabelsOrDefault(
   @java.lang.Override
   public java.lang.String getClusterLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetClusterLabels().getMap();
     if (!map.containsKey(key)) {
@@ -827,7 +829,7 @@ public int getClusterLabelsCount() {
     @java.lang.Override
     public boolean containsClusterLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetClusterLabels().getMap().containsKey(key);
     }
@@ -867,7 +869,7 @@ public java.util.Map getClusterLabelsMap() {
     public java.lang.String getClusterLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetClusterLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -886,7 +888,7 @@ public java.lang.String getClusterLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getClusterLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetClusterLabels().getMap();
       if (!map.containsKey(key)) {
@@ -912,7 +914,7 @@ public Builder clearClusterLabels() {
      */
     public Builder removeClusterLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableClusterLabels().getMutableMap().remove(key);
       return this;
@@ -935,11 +937,12 @@ public java.util.Map getMutableClusterLabels
      */
     public Builder putClusterLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableClusterLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelectorOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelectorOrBuilder.java
index 27b47f2dce98..41485dec836a 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelectorOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterSelectorOrBuilder.java
@@ -104,7 +104,12 @@ public interface ClusterSelectorOrBuilder
    * map<string, string> cluster_labels = 2 [(.google.api.field_behavior) = REQUIRED];
    * 
    */
-  java.lang.String getClusterLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getClusterLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterStatus.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterStatus.java
index 5ba77c15037f..1758d07b3a69 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterStatus.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClusterStatus.java
@@ -119,6 +119,8 @@ private ClusterStatus(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java
index 17f1cf5a593d..87a315953a76 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ClustersProto.java
@@ -251,243 +251,242 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "int_config\030\023 \001(\0132(.google.cloud.dataproc"
           + ".v1.EndpointConfigB\003\340A\001\022H\n\020metastore_con"
           + "fig\030\024 \001(\0132).google.cloud.dataproc.v1.Met"
-          + "astoreConfigB\003\340A\001\"\236\002\n\024VirtualClusterConf"
-          + "ig\022\033\n\016staging_bucket\030\001 \001(\tB\003\340A\001\022\030\n\013temp_"
-          + "bucket\030\002 \001(\tB\003\340A\001\022[\n\031kubernetes_cluster_"
-          + "config\030\006 \001(\01321.google.cloud.dataproc.v1."
-          + "KubernetesClusterConfigB\003\340A\002H\000\022Y\n\031auxili"
-          + "ary_services_config\030\007 \001(\01321.google.cloud"
-          + ".dataproc.v1.AuxiliaryServicesConfigB\003\340A"
-          + "\001B\027\n\025infrastructure_config\"\301\001\n\027Auxiliary"
-          + "ServicesConfig\022H\n\020metastore_config\030\001 \001(\013"
-          + "2).google.cloud.dataproc.v1.MetastoreCon"
-          + "figB\003\340A\001\022\\\n\033spark_history_server_config\030"
-          + "\002 \001(\01322.google.cloud.dataproc.v1.SparkHi"
-          + "storyServerConfigB\003\340A\001\"\272\001\n\016EndpointConfi"
-          + "g\022P\n\nhttp_ports\030\001 \003(\01327.google.cloud.dat"
-          + "aproc.v1.EndpointConfig.HttpPortsEntryB\003"
-          + "\340A\003\022$\n\027enable_http_port_access\030\002 \001(\010B\003\340A"
-          + "\001\0320\n\016HttpPortsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu"
-          + "e\030\002 \001(\t:\0028\001\",\n\021AutoscalingConfig\022\027\n\npoli"
-          + "cy_uri\030\001 \001(\tB\003\340A\001\"4\n\020EncryptionConfig\022 \n"
-          + "\023gce_pd_kms_key_name\030\001 \001(\tB\003\340A\001\"\233\007\n\020GceC"
-          + "lusterConfig\022\025\n\010zone_uri\030\001 \001(\tB\003\340A\001\022\030\n\013n"
-          + "etwork_uri\030\002 \001(\tB\003\340A\001\022\033\n\016subnetwork_uri\030"
-          + "\006 \001(\tB\003\340A\001\022\035\n\020internal_ip_only\030\007 \001(\010B\003\340A"
-          + "\001\022k\n\032private_ipv6_google_access\030\014 \001(\0162B."
-          + "google.cloud.dataproc.v1.GceClusterConfi"
-          + "g.PrivateIpv6GoogleAccessB\003\340A\001\022\034\n\017servic"
-          + "e_account\030\010 \001(\tB\003\340A\001\022#\n\026service_account_"
-          + "scopes\030\003 \003(\tB\003\340A\001\022\014\n\004tags\030\004 \003(\t\022J\n\010metad"
-          + "ata\030\005 \003(\01328.google.cloud.dataproc.v1.Gce"
-          + "ClusterConfig.MetadataEntry\022P\n\024reservati"
-          + "on_affinity\030\013 \001(\0132-.google.cloud.datapro"
-          + "c.v1.ReservationAffinityB\003\340A\001\022M\n\023node_gr"
-          + "oup_affinity\030\r \001(\0132+.google.cloud.datapr"
-          + "oc.v1.NodeGroupAffinityB\003\340A\001\022W\n\030shielded"
-          + "_instance_config\030\016 \001(\01320.google.cloud.da"
-          + "taproc.v1.ShieldedInstanceConfigB\003\340A\001\022_\n"
-          + "\034confidential_instance_config\030\017 \001(\01324.go"
-          + "ogle.cloud.dataproc.v1.ConfidentialInsta"
-          + "nceConfigB\003\340A\001\032/\n\rMetadataEntry\022\013\n\003key\030\001"
-          + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203\001\n\027PrivateIpv6G"
-          + "oogleAccess\022*\n&PRIVATE_IPV6_GOOGLE_ACCES"
-          + "S_UNSPECIFIED\020\000\022\033\n\027INHERIT_FROM_SUBNETWO"
-          + "RK\020\001\022\014\n\010OUTBOUND\020\002\022\021\n\rBIDIRECTIONAL\020\003\"0\n"
-          + "\021NodeGroupAffinity\022\033\n\016node_group_uri\030\001 \001"
-          + "(\tB\003\340A\002\"}\n\026ShieldedInstanceConfig\022\037\n\022ena"
-          + "ble_secure_boot\030\001 \001(\010B\003\340A\001\022\030\n\013enable_vtp"
-          + "m\030\002 \001(\010B\003\340A\001\022(\n\033enable_integrity_monitor"
-          + "ing\030\003 \001(\010B\003\340A\001\"F\n\032ConfidentialInstanceCo"
-          + "nfig\022(\n\033enable_confidential_compute\030\001 \001("
-          + "\010B\003\340A\001\"\315\004\n\023InstanceGroupConfig\022\032\n\rnum_in"
-          + "stances\030\001 \001(\005B\003\340A\001\022\033\n\016instance_names\030\002 \003"
-          + "(\tB\003\340A\003\022\026\n\timage_uri\030\003 \001(\tB\003\340A\001\022\035\n\020machi"
-          + "ne_type_uri\030\004 \001(\tB\003\340A\001\022>\n\013disk_config\030\005 "
-          + "\001(\0132$.google.cloud.dataproc.v1.DiskConfi"
-          + "gB\003\340A\001\022\033\n\016is_preemptible\030\006 \001(\010B\003\340A\003\022Y\n\016p"
-          + "reemptibility\030\n \001(\0162<.google.cloud.datap"
-          + "roc.v1.InstanceGroupConfig.Preemptibilit"
-          + "yB\003\340A\001\022O\n\024managed_group_config\030\007 \001(\0132,.g"
-          + "oogle.cloud.dataproc.v1.ManagedGroupConf"
-          + "igB\003\340A\003\022F\n\014accelerators\030\010 \003(\0132+.google.c"
-          + "loud.dataproc.v1.AcceleratorConfigB\003\340A\001\022"
-          + "\035\n\020min_cpu_platform\030\t \001(\tB\003\340A\001\"V\n\016Preemp"
-          + "tibility\022\036\n\032PREEMPTIBILITY_UNSPECIFIED\020\000"
-          + "\022\023\n\017NON_PREEMPTIBLE\020\001\022\017\n\013PREEMPTIBLE\020\002\"c"
-          + "\n\022ManagedGroupConfig\022#\n\026instance_templat"
-          + "e_name\030\001 \001(\tB\003\340A\003\022(\n\033instance_group_mana"
-          + "ger_name\030\002 \001(\tB\003\340A\003\"L\n\021AcceleratorConfig"
-          + "\022\034\n\024accelerator_type_uri\030\001 \001(\t\022\031\n\021accele"
-          + "rator_count\030\002 \001(\005\"\210\001\n\nDiskConfig\022\033\n\016boot"
-          + "_disk_type\030\003 \001(\tB\003\340A\001\022\036\n\021boot_disk_size_"
-          + "gb\030\001 \001(\005B\003\340A\001\022\033\n\016num_local_ssds\030\002 \001(\005B\003\340"
-          + "A\001\022 \n\023local_ssd_interface\030\004 \001(\tB\003\340A\001\"s\n\030"
-          + "NodeInitializationAction\022\034\n\017executable_f"
-          + "ile\030\001 \001(\tB\003\340A\002\0229\n\021execution_timeout\030\002 \001("
-          + "\0132\031.google.protobuf.DurationB\003\340A\001\"\307\003\n\rCl"
-          + "usterStatus\022A\n\005state\030\001 \001(\0162-.google.clou"
-          + "d.dataproc.v1.ClusterStatus.StateB\003\340A\003\022\026"
-          + "\n\006detail\030\002 \001(\tB\006\340A\003\340A\001\0229\n\020state_start_ti"
-          + "me\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A"
-          + "\003\022G\n\010substate\030\004 \001(\01620.google.cloud.datap"
-          + "roc.v1.ClusterStatus.SubstateB\003\340A\003\"\230\001\n\005S"
-          + "tate\022\013\n\007UNKNOWN\020\000\022\014\n\010CREATING\020\001\022\013\n\007RUNNI"
-          + "NG\020\002\022\t\n\005ERROR\020\003\022\027\n\023ERROR_DUE_TO_UPDATE\020\t"
-          + "\022\014\n\010DELETING\020\004\022\014\n\010UPDATING\020\005\022\014\n\010STOPPING"
-          + "\020\006\022\013\n\007STOPPED\020\007\022\014\n\010STARTING\020\010\"<\n\010Substat"
-          + "e\022\017\n\013UNSPECIFIED\020\000\022\r\n\tUNHEALTHY\020\001\022\020\n\014STA"
-          + "LE_STATUS\020\002\"\240\001\n\016SecurityConfig\022F\n\017kerber"
-          + "os_config\030\001 \001(\0132(.google.cloud.dataproc."
-          + "v1.KerberosConfigB\003\340A\001\022F\n\017identity_confi"
-          + "g\030\002 \001(\0132(.google.cloud.dataproc.v1.Ident"
-          + "ityConfigB\003\340A\001\"\220\004\n\016KerberosConfig\022\034\n\017ena"
-          + "ble_kerberos\030\001 \001(\010B\003\340A\001\022(\n\033root_principa"
-          + "l_password_uri\030\002 \001(\tB\003\340A\001\022\030\n\013kms_key_uri"
-          + "\030\003 \001(\tB\003\340A\001\022\031\n\014keystore_uri\030\004 \001(\tB\003\340A\001\022\033"
-          + "\n\016truststore_uri\030\005 \001(\tB\003\340A\001\022\"\n\025keystore_"
-          + "password_uri\030\006 \001(\tB\003\340A\001\022\035\n\020key_password_"
-          + "uri\030\007 \001(\tB\003\340A\001\022$\n\027truststore_password_ur"
-          + "i\030\010 \001(\tB\003\340A\001\022$\n\027cross_realm_trust_realm\030"
-          + "\t \001(\tB\003\340A\001\022\"\n\025cross_realm_trust_kdc\030\n \001("
-          + "\tB\003\340A\001\022+\n\036cross_realm_trust_admin_server"
-          + "\030\013 \001(\tB\003\340A\001\0222\n%cross_realm_trust_shared_"
-          + "password_uri\030\014 \001(\tB\003\340A\001\022\033\n\016kdc_db_key_ur"
-          + "i\030\r \001(\tB\003\340A\001\022\037\n\022tgt_lifetime_hours\030\016 \001(\005"
-          + "B\003\340A\001\022\022\n\005realm\030\017 \001(\tB\003\340A\001\"\306\001\n\016IdentityCo"
-          + "nfig\022r\n\034user_service_account_mapping\030\001 \003"
-          + "(\0132G.google.cloud.dataproc.v1.IdentityCo"
-          + "nfig.UserServiceAccountMappingEntryB\003\340A\002"
-          + "\032@\n\036UserServiceAccountMappingEntry\022\013\n\003ke"
-          + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\371\001\n\016SoftwareC"
-          + "onfig\022\032\n\rimage_version\030\001 \001(\tB\003\340A\001\022Q\n\npro"
-          + "perties\030\002 \003(\01328.google.cloud.dataproc.v1"
-          + ".SoftwareConfig.PropertiesEntryB\003\340A\001\022E\n\023"
-          + "optional_components\030\003 \003(\0162#.google.cloud"
-          + ".dataproc.v1.ComponentB\003\340A\001\0321\n\017Propertie"
-          + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203"
-          + "\002\n\017LifecycleConfig\0227\n\017idle_delete_ttl\030\001 "
-          + "\001(\0132\031.google.protobuf.DurationB\003\340A\001\022;\n\020a"
-          + "uto_delete_time\030\002 \001(\0132\032.google.protobuf."
-          + "TimestampB\003\340A\001H\000\0229\n\017auto_delete_ttl\030\003 \001("
-          + "\0132\031.google.protobuf.DurationB\003\340A\001H\000\0228\n\017i"
-          + "dle_start_time\030\004 \001(\0132\032.google.protobuf.T"
-          + "imestampB\003\340A\003B\005\n\003ttl\"_\n\017MetastoreConfig\022"
-          + "L\n\032dataproc_metastore_service\030\001 \001(\tB(\340A\002"
-          + "\372A\"\n metastore.googleapis.com/Service\"\232\002"
-          + "\n\016ClusterMetrics\022O\n\014hdfs_metrics\030\001 \003(\01329"
-          + ".google.cloud.dataproc.v1.ClusterMetrics"
-          + ".HdfsMetricsEntry\022O\n\014yarn_metrics\030\002 \003(\0132"
-          + "9.google.cloud.dataproc.v1.ClusterMetric"
-          + "s.YarnMetricsEntry\0322\n\020HdfsMetricsEntry\022\013"
-          + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\0028\001\0322\n\020YarnMe"
-          + "tricsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003:\002"
-          + "8\001\"\356\001\n\024CreateClusterRequest\022\027\n\nproject_i"
-          + "d\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\0227\n\007clu"
-          + "ster\030\002 \001(\0132!.google.cloud.dataproc.v1.Cl"
-          + "usterB\003\340A\002\022\027\n\nrequest_id\030\004 \001(\tB\003\340A\001\022V\n a"
-          + "ction_on_failed_primary_workers\030\005 \001(\0162\'."
-          + "google.cloud.dataproc.v1.FailureActionB\003"
-          + "\340A\001\"\256\002\n\024UpdateClusterRequest\022\027\n\nproject_"
-          + "id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\005 \001(\tB\003\340A\002\022\031\n\014cl"
-          + "uster_name\030\002 \001(\tB\003\340A\002\0227\n\007cluster\030\003 \001(\0132!"
-          + ".google.cloud.dataproc.v1.ClusterB\003\340A\002\022E"
-          + "\n\035graceful_decommission_timeout\030\006 \001(\0132\031."
-          + "google.protobuf.DurationB\003\340A\001\0224\n\013update_"
-          + "mask\030\004 \001(\0132\032.google.protobuf.FieldMaskB\003"
-          + "\340A\002\022\027\n\nrequest_id\030\007 \001(\tB\003\340A\001\"\221\001\n\022StopClu"
-          + "sterRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006"
-          + "region\030\002 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\003 \001(\tB"
-          + "\003\340A\002\022\031\n\014cluster_uuid\030\004 \001(\tB\003\340A\001\022\027\n\nreque"
-          + "st_id\030\005 \001(\tB\003\340A\001\"\222\001\n\023StartClusterRequest"
-          + "\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\002 \001("
-          + "\tB\003\340A\002\022\031\n\014cluster_name\030\003 \001(\tB\003\340A\002\022\031\n\014clu"
-          + "ster_uuid\030\004 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\005 \001(\t"
-          + "B\003\340A\001\"\223\001\n\024DeleteClusterRequest\022\027\n\nprojec"
+          + "astoreConfigB\003\340A\001\"\204\002\n\024VirtualClusterConf"
+          + "ig\022\033\n\016staging_bucket\030\001 \001(\tB\003\340A\001\022[\n\031kuber"
+          + "netes_cluster_config\030\006 \001(\01321.google.clou"
+          + "d.dataproc.v1.KubernetesClusterConfigB\003\340"
+          + "A\002H\000\022Y\n\031auxiliary_services_config\030\007 \001(\0132"
+          + "1.google.cloud.dataproc.v1.AuxiliaryServ"
+          + "icesConfigB\003\340A\001B\027\n\025infrastructure_config"
+          + "\"\301\001\n\027AuxiliaryServicesConfig\022H\n\020metastor"
+          + "e_config\030\001 \001(\0132).google.cloud.dataproc.v"
+          + "1.MetastoreConfigB\003\340A\001\022\\\n\033spark_history_"
+          + "server_config\030\002 \001(\01322.google.cloud.datap"
+          + "roc.v1.SparkHistoryServerConfigB\003\340A\001\"\272\001\n"
+          + "\016EndpointConfig\022P\n\nhttp_ports\030\001 \003(\01327.go"
+          + "ogle.cloud.dataproc.v1.EndpointConfig.Ht"
+          + "tpPortsEntryB\003\340A\003\022$\n\027enable_http_port_ac"
+          + "cess\030\002 \001(\010B\003\340A\001\0320\n\016HttpPortsEntry\022\013\n\003key"
+          + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\",\n\021Autoscaling"
+          + "Config\022\027\n\npolicy_uri\030\001 \001(\tB\003\340A\001\"4\n\020Encry"
+          + "ptionConfig\022 \n\023gce_pd_kms_key_name\030\001 \001(\t"
+          + "B\003\340A\001\"\233\007\n\020GceClusterConfig\022\025\n\010zone_uri\030\001"
+          + " \001(\tB\003\340A\001\022\030\n\013network_uri\030\002 \001(\tB\003\340A\001\022\033\n\016s"
+          + "ubnetwork_uri\030\006 \001(\tB\003\340A\001\022\035\n\020internal_ip_"
+          + "only\030\007 \001(\010B\003\340A\001\022k\n\032private_ipv6_google_a"
+          + "ccess\030\014 \001(\0162B.google.cloud.dataproc.v1.G"
+          + "ceClusterConfig.PrivateIpv6GoogleAccessB"
+          + "\003\340A\001\022\034\n\017service_account\030\010 \001(\tB\003\340A\001\022#\n\026se"
+          + "rvice_account_scopes\030\003 \003(\tB\003\340A\001\022\014\n\004tags\030"
+          + "\004 \003(\t\022J\n\010metadata\030\005 \003(\01328.google.cloud.d"
+          + "ataproc.v1.GceClusterConfig.MetadataEntr"
+          + "y\022P\n\024reservation_affinity\030\013 \001(\0132-.google"
+          + ".cloud.dataproc.v1.ReservationAffinityB\003"
+          + "\340A\001\022M\n\023node_group_affinity\030\r \001(\0132+.googl"
+          + "e.cloud.dataproc.v1.NodeGroupAffinityB\003\340"
+          + "A\001\022W\n\030shielded_instance_config\030\016 \001(\01320.g"
+          + "oogle.cloud.dataproc.v1.ShieldedInstance"
+          + "ConfigB\003\340A\001\022_\n\034confidential_instance_con"
+          + "fig\030\017 \001(\01324.google.cloud.dataproc.v1.Con"
+          + "fidentialInstanceConfigB\003\340A\001\032/\n\rMetadata"
+          + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203\001"
+          + "\n\027PrivateIpv6GoogleAccess\022*\n&PRIVATE_IPV"
+          + "6_GOOGLE_ACCESS_UNSPECIFIED\020\000\022\033\n\027INHERIT"
+          + "_FROM_SUBNETWORK\020\001\022\014\n\010OUTBOUND\020\002\022\021\n\rBIDI"
+          + "RECTIONAL\020\003\"0\n\021NodeGroupAffinity\022\033\n\016node"
+          + "_group_uri\030\001 \001(\tB\003\340A\002\"}\n\026ShieldedInstanc"
+          + "eConfig\022\037\n\022enable_secure_boot\030\001 \001(\010B\003\340A\001"
+          + "\022\030\n\013enable_vtpm\030\002 \001(\010B\003\340A\001\022(\n\033enable_int"
+          + "egrity_monitoring\030\003 \001(\010B\003\340A\001\"F\n\032Confiden"
+          + "tialInstanceConfig\022(\n\033enable_confidentia"
+          + "l_compute\030\001 \001(\010B\003\340A\001\"\315\004\n\023InstanceGroupCo"
+          + "nfig\022\032\n\rnum_instances\030\001 \001(\005B\003\340A\001\022\033\n\016inst"
+          + "ance_names\030\002 \003(\tB\003\340A\003\022\026\n\timage_uri\030\003 \001(\t"
+          + "B\003\340A\001\022\035\n\020machine_type_uri\030\004 \001(\tB\003\340A\001\022>\n\013"
+          + "disk_config\030\005 \001(\0132$.google.cloud.datapro"
+          + "c.v1.DiskConfigB\003\340A\001\022\033\n\016is_preemptible\030\006"
+          + " \001(\010B\003\340A\003\022Y\n\016preemptibility\030\n \001(\0162<.goog"
+          + "le.cloud.dataproc.v1.InstanceGroupConfig"
+          + ".PreemptibilityB\003\340A\001\022O\n\024managed_group_co"
+          + "nfig\030\007 \001(\0132,.google.cloud.dataproc.v1.Ma"
+          + "nagedGroupConfigB\003\340A\003\022F\n\014accelerators\030\010 "
+          + "\003(\0132+.google.cloud.dataproc.v1.Accelerat"
+          + "orConfigB\003\340A\001\022\035\n\020min_cpu_platform\030\t \001(\tB"
+          + "\003\340A\001\"V\n\016Preemptibility\022\036\n\032PREEMPTIBILITY"
+          + "_UNSPECIFIED\020\000\022\023\n\017NON_PREEMPTIBLE\020\001\022\017\n\013P"
+          + "REEMPTIBLE\020\002\"c\n\022ManagedGroupConfig\022#\n\026in"
+          + "stance_template_name\030\001 \001(\tB\003\340A\003\022(\n\033insta"
+          + "nce_group_manager_name\030\002 \001(\tB\003\340A\003\"L\n\021Acc"
+          + "eleratorConfig\022\034\n\024accelerator_type_uri\030\001"
+          + " \001(\t\022\031\n\021accelerator_count\030\002 \001(\005\"\210\001\n\nDisk"
+          + "Config\022\033\n\016boot_disk_type\030\003 \001(\tB\003\340A\001\022\036\n\021b"
+          + "oot_disk_size_gb\030\001 \001(\005B\003\340A\001\022\033\n\016num_local"
+          + "_ssds\030\002 \001(\005B\003\340A\001\022 \n\023local_ssd_interface\030"
+          + "\004 \001(\tB\003\340A\001\"s\n\030NodeInitializationAction\022\034"
+          + "\n\017executable_file\030\001 \001(\tB\003\340A\002\0229\n\021executio"
+          + "n_timeout\030\002 \001(\0132\031.google.protobuf.Durati"
+          + "onB\003\340A\001\"\307\003\n\rClusterStatus\022A\n\005state\030\001 \001(\016"
+          + "2-.google.cloud.dataproc.v1.ClusterStatu"
+          + "s.StateB\003\340A\003\022\026\n\006detail\030\002 \001(\tB\006\340A\003\340A\001\0229\n\020"
+          + "state_start_time\030\003 \001(\0132\032.google.protobuf"
+          + ".TimestampB\003\340A\003\022G\n\010substate\030\004 \001(\01620.goog"
+          + "le.cloud.dataproc.v1.ClusterStatus.Subst"
+          + "ateB\003\340A\003\"\230\001\n\005State\022\013\n\007UNKNOWN\020\000\022\014\n\010CREAT"
+          + "ING\020\001\022\013\n\007RUNNING\020\002\022\t\n\005ERROR\020\003\022\027\n\023ERROR_D"
+          + "UE_TO_UPDATE\020\t\022\014\n\010DELETING\020\004\022\014\n\010UPDATING"
+          + "\020\005\022\014\n\010STOPPING\020\006\022\013\n\007STOPPED\020\007\022\014\n\010STARTIN"
+          + "G\020\010\"<\n\010Substate\022\017\n\013UNSPECIFIED\020\000\022\r\n\tUNHE"
+          + "ALTHY\020\001\022\020\n\014STALE_STATUS\020\002\"\240\001\n\016SecurityCo"
+          + "nfig\022F\n\017kerberos_config\030\001 \001(\0132(.google.c"
+          + "loud.dataproc.v1.KerberosConfigB\003\340A\001\022F\n\017"
+          + "identity_config\030\002 \001(\0132(.google.cloud.dat"
+          + "aproc.v1.IdentityConfigB\003\340A\001\"\220\004\n\016Kerbero"
+          + "sConfig\022\034\n\017enable_kerberos\030\001 \001(\010B\003\340A\001\022(\n"
+          + "\033root_principal_password_uri\030\002 \001(\tB\003\340A\001\022"
+          + "\030\n\013kms_key_uri\030\003 \001(\tB\003\340A\001\022\031\n\014keystore_ur"
+          + "i\030\004 \001(\tB\003\340A\001\022\033\n\016truststore_uri\030\005 \001(\tB\003\340A"
+          + "\001\022\"\n\025keystore_password_uri\030\006 \001(\tB\003\340A\001\022\035\n"
+          + "\020key_password_uri\030\007 \001(\tB\003\340A\001\022$\n\027truststo"
+          + "re_password_uri\030\010 \001(\tB\003\340A\001\022$\n\027cross_real"
+          + "m_trust_realm\030\t \001(\tB\003\340A\001\022\"\n\025cross_realm_"
+          + "trust_kdc\030\n \001(\tB\003\340A\001\022+\n\036cross_realm_trus"
+          + "t_admin_server\030\013 \001(\tB\003\340A\001\0222\n%cross_realm"
+          + "_trust_shared_password_uri\030\014 \001(\tB\003\340A\001\022\033\n"
+          + "\016kdc_db_key_uri\030\r \001(\tB\003\340A\001\022\037\n\022tgt_lifeti"
+          + "me_hours\030\016 \001(\005B\003\340A\001\022\022\n\005realm\030\017 \001(\tB\003\340A\001\""
+          + "\306\001\n\016IdentityConfig\022r\n\034user_service_accou"
+          + "nt_mapping\030\001 \003(\0132G.google.cloud.dataproc"
+          + ".v1.IdentityConfig.UserServiceAccountMap"
+          + "pingEntryB\003\340A\002\032@\n\036UserServiceAccountMapp"
+          + "ingEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001"
+          + "\"\371\001\n\016SoftwareConfig\022\032\n\rimage_version\030\001 \001"
+          + "(\tB\003\340A\001\022Q\n\nproperties\030\002 \003(\01328.google.clo"
+          + "ud.dataproc.v1.SoftwareConfig.Properties"
+          + "EntryB\003\340A\001\022E\n\023optional_components\030\003 \003(\0162"
+          + "#.google.cloud.dataproc.v1.ComponentB\003\340A"
+          + "\001\0321\n\017PropertiesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005val"
+          + "ue\030\002 \001(\t:\0028\001\"\203\002\n\017LifecycleConfig\0227\n\017idle"
+          + "_delete_ttl\030\001 \001(\0132\031.google.protobuf.Dura"
+          + "tionB\003\340A\001\022;\n\020auto_delete_time\030\002 \001(\0132\032.go"
+          + "ogle.protobuf.TimestampB\003\340A\001H\000\0229\n\017auto_d"
+          + "elete_ttl\030\003 \001(\0132\031.google.protobuf.Durati"
+          + "onB\003\340A\001H\000\0228\n\017idle_start_time\030\004 \001(\0132\032.goo"
+          + "gle.protobuf.TimestampB\003\340A\003B\005\n\003ttl\"_\n\017Me"
+          + "tastoreConfig\022L\n\032dataproc_metastore_serv"
+          + "ice\030\001 \001(\tB(\340A\002\372A\"\n metastore.googleapis."
+          + "com/Service\"\232\002\n\016ClusterMetrics\022O\n\014hdfs_m"
+          + "etrics\030\001 \003(\01329.google.cloud.dataproc.v1."
+          + "ClusterMetrics.HdfsMetricsEntry\022O\n\014yarn_"
+          + "metrics\030\002 \003(\01329.google.cloud.dataproc.v1"
+          + ".ClusterMetrics.YarnMetricsEntry\0322\n\020Hdfs"
+          + "MetricsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\003"
+          + ":\0028\001\0322\n\020YarnMetricsEntry\022\013\n\003key\030\001 \001(\t\022\r\n"
+          + "\005value\030\002 \001(\003:\0028\001\"\356\001\n\024CreateClusterReques"
+          + "t\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\003 \001"
+          + "(\tB\003\340A\002\0227\n\007cluster\030\002 \001(\0132!.google.cloud."
+          + "dataproc.v1.ClusterB\003\340A\002\022\027\n\nrequest_id\030\004"
+          + " \001(\tB\003\340A\001\022V\n action_on_failed_primary_wo"
+          + "rkers\030\005 \001(\0162\'.google.cloud.dataproc.v1.F"
+          + "ailureActionB\003\340A\001\"\256\002\n\024UpdateClusterReque"
+          + "st\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\005 "
+          + "\001(\tB\003\340A\002\022\031\n\014cluster_name\030\002 \001(\tB\003\340A\002\0227\n\007c"
+          + "luster\030\003 \001(\0132!.google.cloud.dataproc.v1."
+          + "ClusterB\003\340A\002\022E\n\035graceful_decommission_ti"
+          + "meout\030\006 \001(\0132\031.google.protobuf.DurationB\003"
+          + "\340A\001\0224\n\013update_mask\030\004 \001(\0132\032.google.protob"
+          + "uf.FieldMaskB\003\340A\002\022\027\n\nrequest_id\030\007 \001(\tB\003\340"
+          + "A\001\"\221\001\n\022StopClusterRequest\022\027\n\nproject_id\030"
+          + "\001 \001(\tB\003\340A\002\022\023\n\006region\030\002 \001(\tB\003\340A\002\022\031\n\014clust"
+          + "er_name\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_uuid\030\004 \001(\t"
+          + "B\003\340A\001\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\"\222\001\n\023Start"
+          + "ClusterRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022"
+          + "\023\n\006region\030\002 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\003 \001"
+          + "(\tB\003\340A\002\022\031\n\014cluster_uuid\030\004 \001(\tB\003\340A\001\022\027\n\nre"
+          + "quest_id\030\005 \001(\tB\003\340A\001\"\223\001\n\024DeleteClusterReq"
+          + "uest\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030"
+          + "\003 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\002 \001(\tB\003\340A\002\022\031\n"
+          + "\014cluster_uuid\030\004 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\005"
+          + " \001(\tB\003\340A\001\"\\\n\021GetClusterRequest\022\027\n\nprojec"
           + "t_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\022\031\n\014"
-          + "cluster_name\030\002 \001(\tB\003\340A\002\022\031\n\014cluster_uuid\030"
-          + "\004 \001(\tB\003\340A\001\022\027\n\nrequest_id\030\005 \001(\tB\003\340A\001\"\\\n\021G"
-          + "etClusterRequest\022\027\n\nproject_id\030\001 \001(\tB\003\340A"
-          + "\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\002"
-          + " \001(\tB\003\340A\002\"\211\001\n\023ListClustersRequest\022\027\n\npro"
-          + "ject_id\030\001 \001(\tB\003\340A\002\022\023\n\006region\030\004 \001(\tB\003\340A\002\022"
-          + "\023\n\006filter\030\005 \001(\tB\003\340A\001\022\026\n\tpage_size\030\002 \001(\005B"
-          + "\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"n\n\024ListClu"
-          + "stersResponse\0228\n\010clusters\030\001 \003(\0132!.google"
-          + ".cloud.dataproc.v1.ClusterB\003\340A\003\022\034\n\017next_"
-          + "page_token\030\002 \001(\tB\003\340A\003\"a\n\026DiagnoseCluster"
+          + "cluster_name\030\002 \001(\tB\003\340A\002\"\211\001\n\023ListClusters"
           + "Request\022\027\n\nproject_id\030\001 \001(\tB\003\340A\002\022\023\n\006regi"
-          + "on\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_name\030\002 \001(\tB\003\340A\002"
-          + "\"1\n\026DiagnoseClusterResults\022\027\n\noutput_uri"
-          + "\030\001 \001(\tB\003\340A\003\"\370\001\n\023ReservationAffinity\022Y\n\030c"
-          + "onsume_reservation_type\030\001 \001(\01622.google.c"
-          + "loud.dataproc.v1.ReservationAffinity.Typ"
-          + "eB\003\340A\001\022\020\n\003key\030\002 \001(\tB\003\340A\001\022\023\n\006values\030\003 \003(\t"
-          + "B\003\340A\001\"_\n\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\022\n\016N"
-          + "O_RESERVATION\020\001\022\023\n\017ANY_RESERVATION\020\002\022\030\n\024"
-          + "SPECIFIC_RESERVATION\020\0032\344\020\n\021ClusterContro"
-          + "ller\022\200\002\n\rCreateCluster\022..google.cloud.da"
-          + "taproc.v1.CreateClusterRequest\032\035.google."
-          + "longrunning.Operation\"\237\001\202\323\344\223\002>\"3/v1/proj"
-          + "ects/{project_id}/regions/{region}/clust"
-          + "ers:\007cluster\332A\031project_id,region,cluster"
-          + "\312A<\n\007Cluster\0221google.cloud.dataproc.v1.C"
-          + "lusterOperationMetadata\022\250\002\n\rUpdateCluste"
-          + "r\022..google.cloud.dataproc.v1.UpdateClust"
-          + "erRequest\032\035.google.longrunning.Operation"
-          + "\"\307\001\202\323\344\223\002M2B/v1/projects/{project_id}/reg"
-          + "ions/{region}/clusters/{cluster_name}:\007c"
-          + "luster\332A2project_id,region,cluster_name,"
-          + "cluster,update_mask\312A<\n\007Cluster\0221google."
-          + "cloud.dataproc.v1.ClusterOperationMetada"
-          + "ta\022\356\001\n\013StopCluster\022,.google.cloud.datapr"
-          + "oc.v1.StopClusterRequest\032\035.google.longru"
-          + "nning.Operation\"\221\001\202\323\344\223\002L\"G/v1/projects/{"
-          + "project_id}/regions/{region}/clusters/{c"
-          + "luster_name}:stop:\001*\312A<\n\007Cluster\0221google"
-          + ".cloud.dataproc.v1.ClusterOperationMetad"
-          + "ata\022\361\001\n\014StartCluster\022-.google.cloud.data"
-          + "proc.v1.StartClusterRequest\032\035.google.lon"
-          + "grunning.Operation\"\222\001\202\323\344\223\002M\"H/v1/project"
-          + "s/{project_id}/regions/{region}/clusters"
-          + "/{cluster_name}:start:\001*\312A<\n\007Cluster\0221go"
-          + "ogle.cloud.dataproc.v1.ClusterOperationM"
-          + "etadata\022\231\002\n\rDeleteCluster\022..google.cloud"
-          + ".dataproc.v1.DeleteClusterRequest\032\035.goog"
-          + "le.longrunning.Operation\"\270\001\202\323\344\223\002D*B/v1/p"
-          + "rojects/{project_id}/regions/{region}/cl"
-          + "usters/{cluster_name}\332A\036project_id,regio"
-          + "n,cluster_name\312AJ\n\025google.protobuf.Empty"
-          + "\0221google.cloud.dataproc.v1.ClusterOperat"
-          + "ionMetadata\022\311\001\n\nGetCluster\022+.google.clou"
-          + "d.dataproc.v1.GetClusterRequest\032!.google"
-          + ".cloud.dataproc.v1.Cluster\"k\202\323\344\223\002D\022B/v1/"
-          + "projects/{project_id}/regions/{region}/c"
-          + "lusters/{cluster_name}\332A\036project_id,regi"
-          + "on,cluster_name\022\331\001\n\014ListClusters\022-.googl"
-          + "e.cloud.dataproc.v1.ListClustersRequest\032"
-          + "..google.cloud.dataproc.v1.ListClustersR"
-          + "esponse\"j\202\323\344\223\0025\0223/v1/projects/{project_i"
-          + "d}/regions/{region}/clusters\332A\021project_i"
-          + "d,region\332A\030project_id,region,filter\022\252\002\n\017"
-          + "DiagnoseCluster\0220.google.cloud.dataproc."
-          + "v1.DiagnoseClusterRequest\032\035.google.longr"
-          + "unning.Operation\"\305\001\202\323\344\223\002P\"K/v1/projects/"
-          + "{project_id}/regions/{region}/clusters/{"
-          + "cluster_name}:diagnose:\001*\332A\036project_id,r"
-          + "egion,cluster_name\312AK\n\026DiagnoseClusterRe"
-          + "sults\0221google.cloud.dataproc.v1.ClusterO"
-          + "perationMetadata\032K\312A\027dataproc.googleapis"
-          + ".com\322A.https://www.googleapis.com/auth/c"
-          + "loud-platformB\263\002\n\034com.google.cloud.datap"
-          + "roc.v1B\rClustersProtoP\001Z@google.golang.o"
-          + "rg/genproto/googleapis/cloud/dataproc/v1"
-          + ";dataproc\352A^\n container.googleapis.com/C"
-          + "luster\022:projects/{project}/locations/{lo"
-          + "cation}/clusters/{cluster}\352A^\n metastore"
-          + ".googleapis.com/Service\022:projects/{proje"
-          + "ct}/locations/{location}/services/{servi"
-          + "ce}b\006proto3"
+          + "on\030\004 \001(\tB\003\340A\002\022\023\n\006filter\030\005 \001(\tB\003\340A\001\022\026\n\tpa"
+          + "ge_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003"
+          + "\340A\001\"n\n\024ListClustersResponse\0228\n\010clusters\030"
+          + "\001 \003(\0132!.google.cloud.dataproc.v1.Cluster"
+          + "B\003\340A\003\022\034\n\017next_page_token\030\002 \001(\tB\003\340A\003\"a\n\026D"
+          + "iagnoseClusterRequest\022\027\n\nproject_id\030\001 \001("
+          + "\tB\003\340A\002\022\023\n\006region\030\003 \001(\tB\003\340A\002\022\031\n\014cluster_n"
+          + "ame\030\002 \001(\tB\003\340A\002\"1\n\026DiagnoseClusterResults"
+          + "\022\027\n\noutput_uri\030\001 \001(\tB\003\340A\003\"\370\001\n\023Reservatio"
+          + "nAffinity\022Y\n\030consume_reservation_type\030\001 "
+          + "\001(\01622.google.cloud.dataproc.v1.Reservati"
+          + "onAffinity.TypeB\003\340A\001\022\020\n\003key\030\002 \001(\tB\003\340A\001\022\023"
+          + "\n\006values\030\003 \003(\tB\003\340A\001\"_\n\004Type\022\024\n\020TYPE_UNSP"
+          + "ECIFIED\020\000\022\022\n\016NO_RESERVATION\020\001\022\023\n\017ANY_RES"
+          + "ERVATION\020\002\022\030\n\024SPECIFIC_RESERVATION\020\0032\344\020\n"
+          + "\021ClusterController\022\200\002\n\rCreateCluster\022..g"
+          + "oogle.cloud.dataproc.v1.CreateClusterReq"
+          + "uest\032\035.google.longrunning.Operation\"\237\001\202\323"
+          + "\344\223\002>\"3/v1/projects/{project_id}/regions/"
+          + "{region}/clusters:\007cluster\332A\031project_id,"
+          + "region,cluster\312A<\n\007Cluster\0221google.cloud"
+          + ".dataproc.v1.ClusterOperationMetadata\022\250\002"
+          + "\n\rUpdateCluster\022..google.cloud.dataproc."
+          + "v1.UpdateClusterRequest\032\035.google.longrun"
+          + "ning.Operation\"\307\001\202\323\344\223\002M2B/v1/projects/{p"
+          + "roject_id}/regions/{region}/clusters/{cl"
+          + "uster_name}:\007cluster\332A2project_id,region"
+          + ",cluster_name,cluster,update_mask\312A<\n\007Cl"
+          + "uster\0221google.cloud.dataproc.v1.ClusterO"
+          + "perationMetadata\022\356\001\n\013StopCluster\022,.googl"
+          + "e.cloud.dataproc.v1.StopClusterRequest\032\035"
+          + ".google.longrunning.Operation\"\221\001\202\323\344\223\002L\"G"
+          + "/v1/projects/{project_id}/regions/{regio"
+          + "n}/clusters/{cluster_name}:stop:\001*\312A<\n\007C"
+          + "luster\0221google.cloud.dataproc.v1.Cluster"
+          + "OperationMetadata\022\361\001\n\014StartCluster\022-.goo"
+          + "gle.cloud.dataproc.v1.StartClusterReques"
+          + "t\032\035.google.longrunning.Operation\"\222\001\202\323\344\223\002"
+          + "M\"H/v1/projects/{project_id}/regions/{re"
+          + "gion}/clusters/{cluster_name}:start:\001*\312A"
+          + "<\n\007Cluster\0221google.cloud.dataproc.v1.Clu"
+          + "sterOperationMetadata\022\231\002\n\rDeleteCluster\022"
+          + "..google.cloud.dataproc.v1.DeleteCluster"
+          + "Request\032\035.google.longrunning.Operation\"\270"
+          + "\001\202\323\344\223\002D*B/v1/projects/{project_id}/regio"
+          + "ns/{region}/clusters/{cluster_name}\332A\036pr"
+          + "oject_id,region,cluster_name\312AJ\n\025google."
+          + "protobuf.Empty\0221google.cloud.dataproc.v1"
+          + ".ClusterOperationMetadata\022\311\001\n\nGetCluster"
+          + "\022+.google.cloud.dataproc.v1.GetClusterRe"
+          + "quest\032!.google.cloud.dataproc.v1.Cluster"
+          + "\"k\202\323\344\223\002D\022B/v1/projects/{project_id}/regi"
+          + "ons/{region}/clusters/{cluster_name}\332A\036p"
+          + "roject_id,region,cluster_name\022\331\001\n\014ListCl"
+          + "usters\022-.google.cloud.dataproc.v1.ListCl"
+          + "ustersRequest\032..google.cloud.dataproc.v1"
+          + ".ListClustersResponse\"j\202\323\344\223\0025\0223/v1/proje"
+          + "cts/{project_id}/regions/{region}/cluste"
+          + "rs\332A\021project_id,region\332A\030project_id,regi"
+          + "on,filter\022\252\002\n\017DiagnoseCluster\0220.google.c"
+          + "loud.dataproc.v1.DiagnoseClusterRequest\032"
+          + "\035.google.longrunning.Operation\"\305\001\202\323\344\223\002P\""
+          + "K/v1/projects/{project_id}/regions/{regi"
+          + "on}/clusters/{cluster_name}:diagnose:\001*\332"
+          + "A\036project_id,region,cluster_name\312AK\n\026Dia"
+          + "gnoseClusterResults\0221google.cloud.datapr"
+          + "oc.v1.ClusterOperationMetadata\032K\312A\027datap"
+          + "roc.googleapis.com\322A.https://www.googlea"
+          + "pis.com/auth/cloud-platformB\263\002\n\034com.goog"
+          + "le.cloud.dataproc.v1B\rClustersProtoP\001Z@g"
+          + "oogle.golang.org/genproto/googleapis/clo"
+          + "ud/dataproc/v1;dataproc\352A^\n container.go"
+          + "ogleapis.com/Cluster\022:projects/{project}"
+          + "/locations/{location}/clusters/{cluster}"
+          + "\352A^\n metastore.googleapis.com/Service\022:p"
+          + "rojects/{project}/locations/{location}/s"
+          + "ervices/{service}b\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -555,7 +554,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             internal_static_google_cloud_dataproc_v1_VirtualClusterConfig_descriptor,
             new java.lang.String[] {
               "StagingBucket",
-              "TempBucket",
               "KubernetesClusterConfig",
               "AuxiliaryServicesConfig",
               "InfrastructureConfig",
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ConfidentialInstanceConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ConfidentialInstanceConfig.java
index 7b030cfeae22..74792b0f8363 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ConfidentialInstanceConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ConfidentialInstanceConfig.java
@@ -85,6 +85,8 @@ private ConfidentialInstanceConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequest.java
index 77fc7589fef1..82bf38fa78c5 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateAutoscalingPolicyRequest.java
@@ -105,6 +105,8 @@ private CreateAutoscalingPolicyRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateBatchRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateBatchRequest.java
index 29c5ec471d28..f2bd55e51283 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateBatchRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateBatchRequest.java
@@ -119,6 +119,8 @@ private CreateBatchRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateClusterRequest.java
index 1297095d8792..012de03263ec 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateClusterRequest.java
@@ -128,6 +128,8 @@ private CreateClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateWorkflowTemplateRequest.java
index 0ba83f6ea5b7..fe2dd04ef7f2 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/CreateWorkflowTemplateRequest.java
@@ -104,6 +104,8 @@ private CreateWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteAutoscalingPolicyRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteAutoscalingPolicyRequest.java
index 080c604e09bd..4640ae31a695 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteAutoscalingPolicyRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteAutoscalingPolicyRequest.java
@@ -90,6 +90,8 @@ private DeleteAutoscalingPolicyRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteBatchRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteBatchRequest.java
index 7efd27a99e9d..c35a2c939162 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteBatchRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteBatchRequest.java
@@ -88,6 +88,8 @@ private DeleteBatchRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteClusterRequest.java
index 0069a5121939..3445f6fab9be 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteClusterRequest.java
@@ -120,6 +120,8 @@ private DeleteClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteJobRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteJobRequest.java
index 99c4e88a9145..86d2febe3dc3 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteJobRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteJobRequest.java
@@ -104,6 +104,8 @@ private DeleteJobRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteWorkflowTemplateRequest.java
index 5e2b10b7cc77..c6bc36e7cd74 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DeleteWorkflowTemplateRequest.java
@@ -94,6 +94,8 @@ private DeleteWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterRequest.java
index 7ef1d4f700da..ca36b01b6721 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterRequest.java
@@ -104,6 +104,8 @@ private DiagnoseClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterResults.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterResults.java
index ba86b5e5251d..8b53152e8758 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterResults.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiagnoseClusterResults.java
@@ -88,6 +88,8 @@ private DiagnoseClusterResults(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiskConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiskConfig.java
index 756752ac325a..d3b30aa37026 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiskConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/DiskConfig.java
@@ -106,6 +106,8 @@ private DiskConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EncryptionConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EncryptionConfig.java
index 08ea3971c9f6..93fc085fda25 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EncryptionConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EncryptionConfig.java
@@ -88,6 +88,8 @@ private EncryptionConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfig.java
index da50cb51aa8f..42f84224dcf5 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfig.java
@@ -100,6 +100,8 @@ private EndpointConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -173,7 +175,7 @@ public int getHttpPortsCount() {
   @java.lang.Override
   public boolean containsHttpPorts(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetHttpPorts().getMap().containsKey(key);
   }
@@ -213,7 +215,7 @@ public java.util.Map getHttpPortsMap() {
   public java.lang.String getHttpPortsOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetHttpPorts().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -232,7 +234,7 @@ public java.lang.String getHttpPortsOrDefault(
   @java.lang.Override
   public java.lang.String getHttpPortsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetHttpPorts().getMap();
     if (!map.containsKey(key)) {
@@ -660,7 +662,7 @@ public int getHttpPortsCount() {
     @java.lang.Override
     public boolean containsHttpPorts(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetHttpPorts().getMap().containsKey(key);
     }
@@ -700,7 +702,7 @@ public java.util.Map getHttpPortsMap() {
     public java.lang.String getHttpPortsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetHttpPorts().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -719,7 +721,7 @@ public java.lang.String getHttpPortsOrDefault(
     @java.lang.Override
     public java.lang.String getHttpPortsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetHttpPorts().getMap();
       if (!map.containsKey(key)) {
@@ -745,7 +747,7 @@ public Builder clearHttpPorts() {
      */
     public Builder removeHttpPorts(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableHttpPorts().getMutableMap().remove(key);
       return this;
@@ -768,11 +770,12 @@ public java.util.Map getMutableHttpPorts() {
      */
     public Builder putHttpPorts(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableHttpPorts().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfigOrBuilder.java
index 8e8f93fcc9b4..1facc5b83166 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EndpointConfigOrBuilder.java
@@ -73,7 +73,12 @@ public interface EndpointConfigOrBuilder
    * map<string, string> http_ports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
    * 
    */
-  java.lang.String getHttpPortsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getHttpPortsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EnvironmentConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EnvironmentConfig.java
index 3c01d52483ee..9a0299118155 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EnvironmentConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/EnvironmentConfig.java
@@ -111,6 +111,8 @@ private EnvironmentConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ExecutionConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ExecutionConfig.java
index 3e17a568b074..32cf5c0de658 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ExecutionConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ExecutionConfig.java
@@ -122,6 +122,8 @@ private ExecutionConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfig.java
index fb7e418ec3fe..8a5dafe45967 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfig.java
@@ -230,6 +230,8 @@ private GceClusterConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -1000,7 +1002,7 @@ public int getMetadataCount() {
   @java.lang.Override
   public boolean containsMetadata(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetMetadata().getMap().containsKey(key);
   }
@@ -1040,7 +1042,7 @@ public java.util.Map getMetadataMap() {
   public java.lang.String getMetadataOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetMetadata().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1059,7 +1061,7 @@ public java.lang.String getMetadataOrDefault(
   @java.lang.Override
   public java.lang.String getMetadataOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetMetadata().getMap();
     if (!map.containsKey(key)) {
@@ -3158,7 +3160,7 @@ public int getMetadataCount() {
     @java.lang.Override
     public boolean containsMetadata(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetMetadata().getMap().containsKey(key);
     }
@@ -3198,7 +3200,7 @@ public java.util.Map getMetadataMap() {
     public java.lang.String getMetadataOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetMetadata().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -3217,7 +3219,7 @@ public java.lang.String getMetadataOrDefault(
     @java.lang.Override
     public java.lang.String getMetadataOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetMetadata().getMap();
       if (!map.containsKey(key)) {
@@ -3243,7 +3245,7 @@ public Builder clearMetadata() {
      */
     public Builder removeMetadata(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableMetadata().getMutableMap().remove(key);
       return this;
@@ -3266,11 +3268,12 @@ public java.util.Map getMutableMetadata() {
      */
     public Builder putMetadata(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableMetadata().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfigOrBuilder.java
index 3b3b2fbd7236..407610faa1e0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GceClusterConfigOrBuilder.java
@@ -433,7 +433,12 @@ public interface GceClusterConfigOrBuilder
    *
    * map<string, string> metadata = 5;
    */
-  java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getMetadataOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetAutoscalingPolicyRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetAutoscalingPolicyRequest.java
index 6da1a8f11368..7f4be4134575 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetAutoscalingPolicyRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetAutoscalingPolicyRequest.java
@@ -88,6 +88,8 @@ private GetAutoscalingPolicyRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetBatchRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetBatchRequest.java
index 9e300434ce47..52ab078c15be 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetBatchRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetBatchRequest.java
@@ -88,6 +88,8 @@ private GetBatchRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetClusterRequest.java
index fa0ae6bbfd3d..8ecc210879fc 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetClusterRequest.java
@@ -104,6 +104,8 @@ private GetClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetJobRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetJobRequest.java
index 37f0748a048a..d5b0dd4e194f 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetJobRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetJobRequest.java
@@ -104,6 +104,8 @@ private GetJobRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetWorkflowTemplateRequest.java
index fa3059565cb5..07062bf81aa0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GetWorkflowTemplateRequest.java
@@ -93,6 +93,8 @@ private GetWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeClusterConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeClusterConfig.java
index 23b7bdf6b596..677d4c16edca 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeClusterConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeClusterConfig.java
@@ -102,6 +102,8 @@ private GkeClusterConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolConfig.java
index 9bb277bd29b9..3b13ae7e87a4 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolConfig.java
@@ -130,6 +130,8 @@ private GkeNodePoolConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -434,6 +436,8 @@ private GkeNodeConfig(
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
         throw e.setUnfinishedMessage(this);
+      } catch (com.google.protobuf.UninitializedMessageException e) {
+        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
       } catch (java.io.IOException e) {
         throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
       } finally {
@@ -2121,6 +2125,8 @@ private GkeNodePoolAcceleratorConfig(
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
         throw e.setUnfinishedMessage(this);
+      } catch (com.google.protobuf.UninitializedMessageException e) {
+        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
       } catch (java.io.IOException e) {
         throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
       } finally {
@@ -2892,6 +2898,8 @@ private GkeNodePoolAutoscalingConfig(
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
         throw e.setUnfinishedMessage(this);
+      } catch (com.google.protobuf.UninitializedMessageException e) {
+        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
       } catch (java.io.IOException e) {
         throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
       } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolTarget.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolTarget.java
index 5d501e880f41..1e35fc6bb781 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolTarget.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/GkeNodePoolTarget.java
@@ -131,6 +131,8 @@ private GkeNodePoolTarget(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJob.java
index 6a5663dbe61a..c2ced3dbb7b0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJob.java
@@ -174,6 +174,8 @@ private HadoopJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -739,7 +741,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -783,7 +785,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -804,7 +806,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -2538,7 +2540,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -2582,7 +2584,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2603,7 +2605,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -2631,7 +2633,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -2656,11 +2658,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJobOrBuilder.java
index 2ac0697f7f99..8d14389afed2 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HadoopJobOrBuilder.java
@@ -406,7 +406,12 @@ public interface HadoopJobOrBuilder
    * map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJob.java
index f93e4aca0742..5dab6b48b6f7 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJob.java
@@ -153,6 +153,8 @@ private HiveJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -421,7 +423,7 @@ public int getScriptVariablesCount() {
   @java.lang.Override
   public boolean containsScriptVariables(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetScriptVariables().getMap().containsKey(key);
   }
@@ -461,7 +463,7 @@ public java.util.Map getScriptVariablesMap()
   public java.lang.String getScriptVariablesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -480,7 +482,7 @@ public java.lang.String getScriptVariablesOrDefault(
   @java.lang.Override
   public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     if (!map.containsKey(key)) {
@@ -530,7 +532,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -574,7 +576,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -595,7 +597,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1415,8 +1417,9 @@ public Builder mergeQueryList(com.google.cloud.dataproc.v1.QueryList value) {
       } else {
         if (queriesCase_ == 2) {
           queryListBuilder_.mergeFrom(value);
+        } else {
+          queryListBuilder_.setMessage(value);
         }
-        queryListBuilder_.setMessage(value);
       }
       queriesCase_ = 2;
       return this;
@@ -1614,7 +1617,7 @@ public int getScriptVariablesCount() {
     @java.lang.Override
     public boolean containsScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetScriptVariables().getMap().containsKey(key);
     }
@@ -1656,7 +1659,7 @@ public java.util.Map getScriptVariablesMap()
     public java.lang.String getScriptVariablesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1676,7 +1679,7 @@ public java.lang.String getScriptVariablesOrDefault(
     @java.lang.Override
     public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       if (!map.containsKey(key)) {
@@ -1703,7 +1706,7 @@ public Builder clearScriptVariables() {
      */
     public Builder removeScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableScriptVariables().getMutableMap().remove(key);
       return this;
@@ -1727,11 +1730,12 @@ public java.util.Map getMutableScriptVariabl
      */
     public Builder putScriptVariables(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableScriptVariables().getMutableMap().put(key, value);
       return this;
     }
@@ -1796,7 +1800,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1840,7 +1844,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1861,7 +1865,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1889,7 +1893,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1914,11 +1918,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJobOrBuilder.java
index 56fbdebfe812..3ec982082294 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/HiveJobOrBuilder.java
@@ -160,7 +160,12 @@ public interface HiveJobOrBuilder
    * map<string, string> script_variables = 4 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getScriptVariablesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getScriptVariablesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
@@ -232,7 +237,12 @@ public interface HiveJobOrBuilder
    * map<string, string> properties = 5 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfig.java
index ead588db456f..e809b540fce6 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfig.java
@@ -101,6 +101,8 @@ private IdentityConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -177,7 +179,7 @@ public int getUserServiceAccountMappingCount() {
   @java.lang.Override
   public boolean containsUserServiceAccountMapping(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetUserServiceAccountMapping().getMap().containsKey(key);
   }
@@ -217,7 +219,7 @@ public java.util.Map getUserServiceAccountMa
   public java.lang.String getUserServiceAccountMappingOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map =
         internalGetUserServiceAccountMapping().getMap();
@@ -237,7 +239,7 @@ public java.lang.String getUserServiceAccountMappingOrDefault(
   @java.lang.Override
   public java.lang.String getUserServiceAccountMappingOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map =
         internalGetUserServiceAccountMapping().getMap();
@@ -642,7 +644,7 @@ public int getUserServiceAccountMappingCount() {
     @java.lang.Override
     public boolean containsUserServiceAccountMapping(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetUserServiceAccountMapping().getMap().containsKey(key);
     }
@@ -682,7 +684,7 @@ public java.util.Map getUserServiceAccountMa
     public java.lang.String getUserServiceAccountMappingOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetUserServiceAccountMapping().getMap();
@@ -702,7 +704,7 @@ public java.lang.String getUserServiceAccountMappingOrDefault(
     @java.lang.Override
     public java.lang.String getUserServiceAccountMappingOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetUserServiceAccountMapping().getMap();
@@ -729,7 +731,7 @@ public Builder clearUserServiceAccountMapping() {
      */
     public Builder removeUserServiceAccountMapping(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableUserServiceAccountMapping().getMutableMap().remove(key);
       return this;
@@ -752,11 +754,12 @@ public java.util.Map getMutableUserServiceAc
      */
     public Builder putUserServiceAccountMapping(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableUserServiceAccountMapping().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfigOrBuilder.java
index 8e42dfecd767..023e87a5431a 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/IdentityConfigOrBuilder.java
@@ -73,8 +73,12 @@ public interface IdentityConfigOrBuilder
    * map<string, string> user_service_account_mapping = 1 [(.google.api.field_behavior) = REQUIRED];
    * 
    */
+
+  /* nullable */
   java.lang.String getUserServiceAccountMappingOrDefault(
-      java.lang.String key, java.lang.String defaultValue);
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupAutoscalingPolicyConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupAutoscalingPolicyConfig.java
index e1ed8a7d8748..4195c71270e8 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupAutoscalingPolicyConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupAutoscalingPolicyConfig.java
@@ -97,6 +97,8 @@ private InstanceGroupAutoscalingPolicyConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfig.java
index 202f4c4efee5..64c77a107b51 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstanceGroupConfig.java
@@ -180,6 +180,8 @@ private InstanceGroupConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateInlineWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateInlineWorkflowTemplateRequest.java
index 8cf503adbcc9..0c641e2d90a5 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateInlineWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateInlineWorkflowTemplateRequest.java
@@ -114,6 +114,8 @@ private InstantiateInlineWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequest.java
index 10c1b251d3f4..9df925b62cee 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequest.java
@@ -118,6 +118,8 @@ private InstantiateWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -341,7 +343,7 @@ public int getParametersCount() {
   @java.lang.Override
   public boolean containsParameters(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetParameters().getMap().containsKey(key);
   }
@@ -381,7 +383,7 @@ public java.util.Map getParametersMap() {
   public java.lang.String getParametersOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetParameters().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -400,7 +402,7 @@ public java.lang.String getParametersOrDefault(
   @java.lang.Override
   public java.lang.String getParametersOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetParameters().getMap();
     if (!map.containsKey(key)) {
@@ -1200,7 +1202,7 @@ public int getParametersCount() {
     @java.lang.Override
     public boolean containsParameters(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetParameters().getMap().containsKey(key);
     }
@@ -1240,7 +1242,7 @@ public java.util.Map getParametersMap() {
     public java.lang.String getParametersOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetParameters().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1259,7 +1261,7 @@ public java.lang.String getParametersOrDefault(
     @java.lang.Override
     public java.lang.String getParametersOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetParameters().getMap();
       if (!map.containsKey(key)) {
@@ -1285,7 +1287,7 @@ public Builder clearParameters() {
      */
     public Builder removeParameters(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableParameters().getMutableMap().remove(key);
       return this;
@@ -1308,11 +1310,12 @@ public java.util.Map getMutableParameters()
      */
     public Builder putParameters(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableParameters().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequestOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequestOrBuilder.java
index cd7510b5d3de..5ef0491fa3a2 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequestOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/InstantiateWorkflowTemplateRequestOrBuilder.java
@@ -170,7 +170,12 @@ public interface InstantiateWorkflowTemplateRequestOrBuilder
    * map<string, string> parameters = 6 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getParametersOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getParametersOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Job.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Job.java
index 44b4de436936..a8db524b4477 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Job.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/Job.java
@@ -340,6 +340,8 @@ private Job(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -1390,7 +1392,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -1437,7 +1439,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1460,7 +1462,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -3034,8 +3036,9 @@ public Builder mergeHadoopJob(com.google.cloud.dataproc.v1.HadoopJob value) {
       } else {
         if (typeJobCase_ == 3) {
           hadoopJobBuilder_.mergeFrom(value);
+        } else {
+          hadoopJobBuilder_.setMessage(value);
         }
-        hadoopJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 3;
       return this;
@@ -3260,8 +3263,9 @@ public Builder mergeSparkJob(com.google.cloud.dataproc.v1.SparkJob value) {
       } else {
         if (typeJobCase_ == 4) {
           sparkJobBuilder_.mergeFrom(value);
+        } else {
+          sparkJobBuilder_.setMessage(value);
         }
-        sparkJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 4;
       return this;
@@ -3486,8 +3490,9 @@ public Builder mergePysparkJob(com.google.cloud.dataproc.v1.PySparkJob value) {
       } else {
         if (typeJobCase_ == 5) {
           pysparkJobBuilder_.mergeFrom(value);
+        } else {
+          pysparkJobBuilder_.setMessage(value);
         }
-        pysparkJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 5;
       return this;
@@ -3712,8 +3717,9 @@ public Builder mergeHiveJob(com.google.cloud.dataproc.v1.HiveJob value) {
       } else {
         if (typeJobCase_ == 6) {
           hiveJobBuilder_.mergeFrom(value);
+        } else {
+          hiveJobBuilder_.setMessage(value);
         }
-        hiveJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 6;
       return this;
@@ -3931,8 +3937,9 @@ public Builder mergePigJob(com.google.cloud.dataproc.v1.PigJob value) {
       } else {
         if (typeJobCase_ == 7) {
           pigJobBuilder_.mergeFrom(value);
+        } else {
+          pigJobBuilder_.setMessage(value);
         }
-        pigJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 7;
       return this;
@@ -4151,8 +4158,9 @@ public Builder mergeSparkRJob(com.google.cloud.dataproc.v1.SparkRJob value) {
       } else {
         if (typeJobCase_ == 21) {
           sparkRJobBuilder_.mergeFrom(value);
+        } else {
+          sparkRJobBuilder_.setMessage(value);
         }
-        sparkRJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 21;
       return this;
@@ -4378,8 +4386,9 @@ public Builder mergeSparkSqlJob(com.google.cloud.dataproc.v1.SparkSqlJob value)
       } else {
         if (typeJobCase_ == 12) {
           sparkSqlJobBuilder_.mergeFrom(value);
+        } else {
+          sparkSqlJobBuilder_.setMessage(value);
         }
-        sparkSqlJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 12;
       return this;
@@ -4604,8 +4613,9 @@ public Builder mergePrestoJob(com.google.cloud.dataproc.v1.PrestoJob value) {
       } else {
         if (typeJobCase_ == 23) {
           prestoJobBuilder_.mergeFrom(value);
+        } else {
+          prestoJobBuilder_.setMessage(value);
         }
-        prestoJobBuilder_.setMessage(value);
       }
       typeJobCase_ = 23;
       return this;
@@ -6032,7 +6042,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -6080,7 +6090,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -6103,7 +6113,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -6133,7 +6143,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -6160,11 +6170,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadata.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadata.java
index 2c6d86a943c5..c2bd5a13a43e 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadata.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobMetadata.java
@@ -127,6 +127,8 @@ private JobMetadata(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobOrBuilder.java
index f70e389ff014..4747c1e252a1 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobOrBuilder.java
@@ -744,7 +744,12 @@ public interface JobOrBuilder
    *
    * map<string, string> labels = 18 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacement.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacement.java
index 70878de8a361..8ba4bdd65ee5 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacement.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacement.java
@@ -114,6 +114,8 @@ private JobPlacement(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -288,7 +290,7 @@ public int getClusterLabelsCount() {
   @java.lang.Override
   public boolean containsClusterLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetClusterLabels().getMap().containsKey(key);
   }
@@ -326,7 +328,7 @@ public java.util.Map getClusterLabelsMap() {
   public java.lang.String getClusterLabelsOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetClusterLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -344,7 +346,7 @@ public java.lang.String getClusterLabelsOrDefault(
   @java.lang.Override
   public java.lang.String getClusterLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetClusterLabels().getMap();
     if (!map.containsKey(key)) {
@@ -987,7 +989,7 @@ public int getClusterLabelsCount() {
     @java.lang.Override
     public boolean containsClusterLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetClusterLabels().getMap().containsKey(key);
     }
@@ -1025,7 +1027,7 @@ public java.util.Map getClusterLabelsMap() {
     public java.lang.String getClusterLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetClusterLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1043,7 +1045,7 @@ public java.lang.String getClusterLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getClusterLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetClusterLabels().getMap();
       if (!map.containsKey(key)) {
@@ -1068,7 +1070,7 @@ public Builder clearClusterLabels() {
      */
     public Builder removeClusterLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableClusterLabels().getMutableMap().remove(key);
       return this;
@@ -1090,11 +1092,12 @@ public java.util.Map getMutableClusterLabels
      */
     public Builder putClusterLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableClusterLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacementOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacementOrBuilder.java
index d6e90b3e21f1..fb61780da9aa 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacementOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobPlacementOrBuilder.java
@@ -121,7 +121,12 @@ public interface JobPlacementOrBuilder
    * map<string, string> cluster_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getClusterLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getClusterLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobReference.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobReference.java
index 315aa42440b5..b0848a3c305d 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobReference.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobReference.java
@@ -96,6 +96,8 @@ private JobReference(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobScheduling.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobScheduling.java
index 9d61996c3852..8f5527103616 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobScheduling.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobScheduling.java
@@ -89,6 +89,8 @@ private JobScheduling(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobStatus.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobStatus.java
index 63b2e415d151..6d6fc357addc 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobStatus.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/JobStatus.java
@@ -119,6 +119,8 @@ private JobStatus(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfig.java
index 904932ab8136..35ff9ffd9c5b 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KerberosConfig.java
@@ -194,6 +194,8 @@ private KerberosConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesClusterConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesClusterConfig.java
index 73587a1b660f..e3d7e36c7610 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesClusterConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesClusterConfig.java
@@ -121,6 +121,8 @@ private KubernetesClusterConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -1005,8 +1007,9 @@ public Builder mergeGkeClusterConfig(com.google.cloud.dataproc.v1.GkeClusterConf
       } else {
         if (configCase_ == 2) {
           gkeClusterConfigBuilder_.mergeFrom(value);
+        } else {
+          gkeClusterConfigBuilder_.setMessage(value);
         }
-        gkeClusterConfigBuilder_.setMessage(value);
       }
       configCase_ = 2;
       return this;
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfig.java
index 9780b0baf432..60ac1aa0543a 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfig.java
@@ -112,6 +112,8 @@ private KubernetesSoftwareConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -190,7 +192,7 @@ public int getComponentVersionCount() {
   @java.lang.Override
   public boolean containsComponentVersion(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetComponentVersion().getMap().containsKey(key);
   }
@@ -232,7 +234,7 @@ public java.util.Map getComponentVersionMap(
   public java.lang.String getComponentVersionOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetComponentVersion().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -252,7 +254,7 @@ public java.lang.String getComponentVersionOrDefault(
   @java.lang.Override
   public java.lang.String getComponentVersionOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetComponentVersion().getMap();
     if (!map.containsKey(key)) {
@@ -304,7 +306,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -352,7 +354,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -375,7 +377,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -800,7 +802,7 @@ public int getComponentVersionCount() {
     @java.lang.Override
     public boolean containsComponentVersion(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetComponentVersion().getMap().containsKey(key);
     }
@@ -842,7 +844,7 @@ public java.util.Map getComponentVersionMap(
     public java.lang.String getComponentVersionOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetComponentVersion().getMap();
@@ -863,7 +865,7 @@ public java.lang.String getComponentVersionOrDefault(
     @java.lang.Override
     public java.lang.String getComponentVersionOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetComponentVersion().getMap();
@@ -891,7 +893,7 @@ public Builder clearComponentVersion() {
      */
     public Builder removeComponentVersion(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableComponentVersion().getMutableMap().remove(key);
       return this;
@@ -915,11 +917,12 @@ public java.util.Map getMutableComponentVers
      */
     public Builder putComponentVersion(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableComponentVersion().getMutableMap().put(key, value);
       return this;
     }
@@ -987,7 +990,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1035,7 +1038,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1058,7 +1061,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1088,7 +1091,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1115,11 +1118,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfigOrBuilder.java
index 05673c71af1b..e6db7aaf3c12 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/KubernetesSoftwareConfigOrBuilder.java
@@ -77,8 +77,12 @@ public interface KubernetesSoftwareConfigOrBuilder
    *
    * map<string, string> component_version = 1;
    */
+
+  /* nullable */
   java.lang.String getComponentVersionOrDefault(
-      java.lang.String key, java.lang.String defaultValue);
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
@@ -159,7 +163,12 @@ java.lang.String getComponentVersionOrDefault(
    *
    * map<string, string> properties = 2;
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LifecycleConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LifecycleConfig.java
index 92751d87ebfe..4ea8d8507849 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LifecycleConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LifecycleConfig.java
@@ -137,6 +137,8 @@ private LifecycleConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -1261,8 +1263,9 @@ public Builder mergeAutoDeleteTime(com.google.protobuf.Timestamp value) {
       } else {
         if (ttlCase_ == 2) {
           autoDeleteTimeBuilder_.mergeFrom(value);
+        } else {
+          autoDeleteTimeBuilder_.setMessage(value);
         }
-        autoDeleteTimeBuilder_.setMessage(value);
       }
       ttlCase_ = 2;
       return this;
@@ -1502,8 +1505,9 @@ public Builder mergeAutoDeleteTtl(com.google.protobuf.Duration value) {
       } else {
         if (ttlCase_ == 3) {
           autoDeleteTtlBuilder_.mergeFrom(value);
+        } else {
+          autoDeleteTtlBuilder_.setMessage(value);
         }
-        autoDeleteTtlBuilder_.setMessage(value);
       }
       ttlCase_ = 3;
       return this;
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesRequest.java
index 46f1fec57192..f8bbeff9f613 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesRequest.java
@@ -102,6 +102,8 @@ private ListAutoscalingPoliciesRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesResponse.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesResponse.java
index 60d48fe32ed6..8cc594464efa 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesResponse.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListAutoscalingPoliciesResponse.java
@@ -103,6 +103,8 @@ private ListAutoscalingPoliciesResponse(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesRequest.java
index 09cd5aa31aff..c454294e1c27 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesRequest.java
@@ -101,6 +101,8 @@ private ListBatchesRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesResponse.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesResponse.java
index 4106275b3d2e..e006f43738c8 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesResponse.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListBatchesResponse.java
@@ -101,6 +101,8 @@ private ListBatchesResponse(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersRequest.java
index 5d9143b6eefc..725a89b8f78b 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersRequest.java
@@ -117,6 +117,8 @@ private ListClustersRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersResponse.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersResponse.java
index 4fcfb8318d7f..a3de71b650d9 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersResponse.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListClustersResponse.java
@@ -101,6 +101,8 @@ private ListClustersResponse(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsRequest.java
index 965f88613805..bf330f97eedb 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsRequest.java
@@ -133,6 +133,8 @@ private ListJobsRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsResponse.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsResponse.java
index 81d200aa398b..278b87b59c36 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsResponse.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListJobsResponse.java
@@ -100,6 +100,8 @@ private ListJobsResponse(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesRequest.java
index abbdffc5d61e..4c6bcd699323 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesRequest.java
@@ -101,6 +101,8 @@ private ListWorkflowTemplatesRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesResponse.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesResponse.java
index 7bad489a5e2c..231e30076bb4 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesResponse.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ListWorkflowTemplatesResponse.java
@@ -102,6 +102,8 @@ private ListWorkflowTemplatesResponse(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java
index 3539c904b0a8..fc7f3a62cc69 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LocationName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfig.java
index c64e22d80648..1b0141d98d6b 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfig.java
@@ -97,6 +97,8 @@ private LoggingConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -480,7 +482,7 @@ public int getDriverLogLevelsCount() {
   @java.lang.Override
   public boolean containsDriverLogLevels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetDriverLogLevels().getMap().containsKey(key);
   }
@@ -523,10 +525,13 @@ public boolean containsDriverLogLevels(java.lang.String key) {
    * 
    */
   @java.lang.Override
-  public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrDefault(
-      java.lang.String key, com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue) {
+  public /* nullable */ com.google.cloud.dataproc.v1.LoggingConfig.Level
+      getDriverLogLevelsOrDefault(
+          java.lang.String key,
+          /* nullable */
+          com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetDriverLogLevels().getMap();
     return map.containsKey(key)
@@ -550,7 +555,7 @@ public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrDefa
   public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrThrow(
       java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetDriverLogLevels().getMap();
     if (!map.containsKey(key)) {
@@ -597,7 +602,7 @@ public java.util.Map getDriverLogLevelsValu
   @java.lang.Override
   public int getDriverLogLevelsValueOrDefault(java.lang.String key, int defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetDriverLogLevels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -618,7 +623,7 @@ public int getDriverLogLevelsValueOrDefault(java.lang.String key, int defaultVal
   @java.lang.Override
   public int getDriverLogLevelsValueOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetDriverLogLevels().getMap();
     if (!map.containsKey(key)) {
@@ -1016,7 +1021,7 @@ public int getDriverLogLevelsCount() {
     @java.lang.Override
     public boolean containsDriverLogLevels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetDriverLogLevels().getMap().containsKey(key);
     }
@@ -1059,10 +1064,13 @@ public boolean containsDriverLogLevels(java.lang.String key) {
      * 
      */
     @java.lang.Override
-    public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrDefault(
-        java.lang.String key, com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue) {
+    public /* nullable */ com.google.cloud.dataproc.v1.LoggingConfig.Level
+        getDriverLogLevelsOrDefault(
+            java.lang.String key,
+            /* nullable */
+            com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetDriverLogLevels().getMap();
@@ -1087,7 +1095,7 @@ public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrDefa
     public com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrThrow(
         java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetDriverLogLevels().getMap();
@@ -1135,7 +1143,7 @@ public java.util.Map getDriverLogLevelsValu
     @java.lang.Override
     public int getDriverLogLevelsValueOrDefault(java.lang.String key, int defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetDriverLogLevels().getMap();
@@ -1157,7 +1165,7 @@ public int getDriverLogLevelsValueOrDefault(java.lang.String key, int defaultVal
     @java.lang.Override
     public int getDriverLogLevelsValueOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map =
           internalGetDriverLogLevels().getMap();
@@ -1186,7 +1194,7 @@ public Builder clearDriverLogLevels() {
      */
     public Builder removeDriverLogLevels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableDriverLogLevels().getMutableMap().remove(key);
       return this;
@@ -1214,11 +1222,9 @@ public Builder removeDriverLogLevels(java.lang.String key) {
     public Builder putDriverLogLevels(
         java.lang.String key, com.google.cloud.dataproc.v1.LoggingConfig.Level value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
-      }
-      if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
+
       internalGetMutableDriverLogLevels()
           .getMutableMap()
           .put(key, driverLogLevelsValueConverter.doBackward(value));
@@ -1263,8 +1269,9 @@ public java.util.Map getMutableDriverLogLev
      */
     public Builder putDriverLogLevelsValue(java.lang.String key, int value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
+
       internalGetMutableDriverLogLevels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfigOrBuilder.java
index 6c70fe8d559b..334f67210d74 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/LoggingConfigOrBuilder.java
@@ -83,8 +83,11 @@ public interface LoggingConfigOrBuilder
    * map<string, .google.cloud.dataproc.v1.LoggingConfig.Level> driver_log_levels = 2;
    * 
    */
+  /* nullable */
   com.google.cloud.dataproc.v1.LoggingConfig.Level getDriverLogLevelsOrDefault(
-      java.lang.String key, com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue);
+      java.lang.String key,
+      /* nullable */
+      com.google.cloud.dataproc.v1.LoggingConfig.Level defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedCluster.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedCluster.java
index c4cc8ccf6ea6..a0ccdd60c565 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedCluster.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedCluster.java
@@ -118,6 +118,8 @@ private ManagedCluster(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -306,7 +308,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -353,7 +355,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -376,7 +378,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -1145,7 +1147,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -1193,7 +1195,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1216,7 +1218,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -1246,7 +1248,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -1273,11 +1275,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedClusterOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedClusterOrBuilder.java
index 7800131f7896..056f92053092 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedClusterOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedClusterOrBuilder.java
@@ -163,7 +163,12 @@ public interface ManagedClusterOrBuilder
    *
    * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedGroupConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedGroupConfig.java
index 8bf61946eb68..695afe43e532 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedGroupConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ManagedGroupConfig.java
@@ -96,6 +96,8 @@ private ManagedGroupConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/MetastoreConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/MetastoreConfig.java
index 05dd108f388b..c57f28b84839 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/MetastoreConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/MetastoreConfig.java
@@ -88,6 +88,8 @@ private MetastoreConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeGroupAffinity.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeGroupAffinity.java
index 39cadb8ea412..13cd15fe992c 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeGroupAffinity.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeGroupAffinity.java
@@ -88,6 +88,8 @@ private NodeGroupAffinity(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeInitializationAction.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeInitializationAction.java
index 9c947e590dd7..233342540873 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeInitializationAction.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/NodeInitializationAction.java
@@ -104,6 +104,8 @@ private NodeInitializationAction(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJob.java
index fb07a4020927..61e90de5910d 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJob.java
@@ -257,6 +257,8 @@ private OrderedJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -917,7 +919,7 @@ public int getLabelsCount() {
   @java.lang.Override
   public boolean containsLabels(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetLabels().getMap().containsKey(key);
   }
@@ -964,7 +966,7 @@ public java.util.Map getLabelsMap() {
   @java.lang.Override
   public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -987,7 +989,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin
   @java.lang.Override
   public java.lang.String getLabelsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetLabels().getMap();
     if (!map.containsKey(key)) {
@@ -2055,8 +2057,9 @@ public Builder mergeHadoopJob(com.google.cloud.dataproc.v1.HadoopJob value) {
       } else {
         if (jobTypeCase_ == 2) {
           hadoopJobBuilder_.mergeFrom(value);
+        } else {
+          hadoopJobBuilder_.setMessage(value);
         }
-        hadoopJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 2;
       return this;
@@ -2281,8 +2284,9 @@ public Builder mergeSparkJob(com.google.cloud.dataproc.v1.SparkJob value) {
       } else {
         if (jobTypeCase_ == 3) {
           sparkJobBuilder_.mergeFrom(value);
+        } else {
+          sparkJobBuilder_.setMessage(value);
         }
-        sparkJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 3;
       return this;
@@ -2507,8 +2511,9 @@ public Builder mergePysparkJob(com.google.cloud.dataproc.v1.PySparkJob value) {
       } else {
         if (jobTypeCase_ == 4) {
           pysparkJobBuilder_.mergeFrom(value);
+        } else {
+          pysparkJobBuilder_.setMessage(value);
         }
-        pysparkJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 4;
       return this;
@@ -2733,8 +2738,9 @@ public Builder mergeHiveJob(com.google.cloud.dataproc.v1.HiveJob value) {
       } else {
         if (jobTypeCase_ == 5) {
           hiveJobBuilder_.mergeFrom(value);
+        } else {
+          hiveJobBuilder_.setMessage(value);
         }
-        hiveJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 5;
       return this;
@@ -2952,8 +2958,9 @@ public Builder mergePigJob(com.google.cloud.dataproc.v1.PigJob value) {
       } else {
         if (jobTypeCase_ == 6) {
           pigJobBuilder_.mergeFrom(value);
+        } else {
+          pigJobBuilder_.setMessage(value);
         }
-        pigJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 6;
       return this;
@@ -3172,8 +3179,9 @@ public Builder mergeSparkRJob(com.google.cloud.dataproc.v1.SparkRJob value) {
       } else {
         if (jobTypeCase_ == 11) {
           sparkRJobBuilder_.mergeFrom(value);
+        } else {
+          sparkRJobBuilder_.setMessage(value);
         }
-        sparkRJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 11;
       return this;
@@ -3399,8 +3407,9 @@ public Builder mergeSparkSqlJob(com.google.cloud.dataproc.v1.SparkSqlJob value)
       } else {
         if (jobTypeCase_ == 7) {
           sparkSqlJobBuilder_.mergeFrom(value);
+        } else {
+          sparkSqlJobBuilder_.setMessage(value);
         }
-        sparkSqlJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 7;
       return this;
@@ -3625,8 +3634,9 @@ public Builder mergePrestoJob(com.google.cloud.dataproc.v1.PrestoJob value) {
       } else {
         if (jobTypeCase_ == 12) {
           prestoJobBuilder_.mergeFrom(value);
+        } else {
+          prestoJobBuilder_.setMessage(value);
         }
-        prestoJobBuilder_.setMessage(value);
       }
       jobTypeCase_ = 12;
       return this;
@@ -3773,7 +3783,7 @@ public int getLabelsCount() {
     @java.lang.Override
     public boolean containsLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetLabels().getMap().containsKey(key);
     }
@@ -3821,7 +3831,7 @@ public java.util.Map getLabelsMap() {
     public java.lang.String getLabelsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -3844,7 +3854,7 @@ public java.lang.String getLabelsOrDefault(
     @java.lang.Override
     public java.lang.String getLabelsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetLabels().getMap();
       if (!map.containsKey(key)) {
@@ -3874,7 +3884,7 @@ public Builder clearLabels() {
      */
     public Builder removeLabels(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableLabels().getMutableMap().remove(key);
       return this;
@@ -3901,11 +3911,12 @@ public java.util.Map getMutableLabels() {
      */
     public Builder putLabels(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableLabels().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJobOrBuilder.java
index 198e4fca21f0..d810593c65a0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/OrderedJobOrBuilder.java
@@ -452,7 +452,12 @@ public interface OrderedJobOrBuilder
    *
    * map<string, string> labels = 8 [(.google.api.field_behavior) = OPTIONAL];
    */
-  java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getLabelsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ParameterValidation.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ParameterValidation.java
index 34f525c558be..72fa4a9023ce 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ParameterValidation.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ParameterValidation.java
@@ -115,6 +115,8 @@ private ParameterValidation(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -786,8 +788,9 @@ public Builder mergeRegex(com.google.cloud.dataproc.v1.RegexValidation value) {
       } else {
         if (validationTypeCase_ == 1) {
           regexBuilder_.mergeFrom(value);
+        } else {
+          regexBuilder_.setMessage(value);
         }
-        regexBuilder_.setMessage(value);
       }
       validationTypeCase_ = 1;
       return this;
@@ -995,8 +998,9 @@ public Builder mergeValues(com.google.cloud.dataproc.v1.ValueValidation value) {
       } else {
         if (validationTypeCase_ == 2) {
           valuesBuilder_.mergeFrom(value);
+        } else {
+          valuesBuilder_.setMessage(value);
         }
-        valuesBuilder_.setMessage(value);
       }
       validationTypeCase_ = 2;
       return this;
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PeripheralsConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PeripheralsConfig.java
index 0b2be90dce8f..67051b0fa153 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PeripheralsConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PeripheralsConfig.java
@@ -105,6 +105,8 @@ private PeripheralsConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJob.java
index 6eed2768338e..c8d2a6b14d94 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJob.java
@@ -169,6 +169,8 @@ private PigJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -437,7 +439,7 @@ public int getScriptVariablesCount() {
   @java.lang.Override
   public boolean containsScriptVariables(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetScriptVariables().getMap().containsKey(key);
   }
@@ -477,7 +479,7 @@ public java.util.Map getScriptVariablesMap()
   public java.lang.String getScriptVariablesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -496,7 +498,7 @@ public java.lang.String getScriptVariablesOrDefault(
   @java.lang.Override
   public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     if (!map.containsKey(key)) {
@@ -546,7 +548,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -590,7 +592,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -611,7 +613,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1509,8 +1511,9 @@ public Builder mergeQueryList(com.google.cloud.dataproc.v1.QueryList value) {
       } else {
         if (queriesCase_ == 2) {
           queryListBuilder_.mergeFrom(value);
+        } else {
+          queryListBuilder_.setMessage(value);
         }
-        queryListBuilder_.setMessage(value);
       }
       queriesCase_ = 2;
       return this;
@@ -1708,7 +1711,7 @@ public int getScriptVariablesCount() {
     @java.lang.Override
     public boolean containsScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetScriptVariables().getMap().containsKey(key);
     }
@@ -1750,7 +1753,7 @@ public java.util.Map getScriptVariablesMap()
     public java.lang.String getScriptVariablesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1770,7 +1773,7 @@ public java.lang.String getScriptVariablesOrDefault(
     @java.lang.Override
     public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       if (!map.containsKey(key)) {
@@ -1797,7 +1800,7 @@ public Builder clearScriptVariables() {
      */
     public Builder removeScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableScriptVariables().getMutableMap().remove(key);
       return this;
@@ -1821,11 +1824,12 @@ public java.util.Map getMutableScriptVariabl
      */
     public Builder putScriptVariables(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableScriptVariables().getMutableMap().put(key, value);
       return this;
     }
@@ -1890,7 +1894,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1934,7 +1938,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1955,7 +1959,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1983,7 +1987,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -2008,11 +2012,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJobOrBuilder.java
index 63d44fe8b924..6c621befbb71 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PigJobOrBuilder.java
@@ -160,7 +160,12 @@ public interface PigJobOrBuilder
    * map<string, string> script_variables = 4 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getScriptVariablesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getScriptVariablesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
@@ -232,7 +237,12 @@ public interface PigJobOrBuilder
    * map<string, string> properties = 5 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJob.java
index 8d244b268ef8..9232f3de8139 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJob.java
@@ -163,6 +163,8 @@ private PrestoJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -540,7 +542,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -582,7 +584,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -602,7 +604,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1431,8 +1433,9 @@ public Builder mergeQueryList(com.google.cloud.dataproc.v1.QueryList value) {
       } else {
         if (queriesCase_ == 2) {
           queryListBuilder_.mergeFrom(value);
+        } else {
+          queryListBuilder_.setMessage(value);
         }
-        queryListBuilder_.setMessage(value);
       }
       queriesCase_ = 2;
       return this;
@@ -1908,7 +1911,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1950,7 +1953,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1970,7 +1973,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1997,7 +2000,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -2021,11 +2024,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJobOrBuilder.java
index acd54f71caa4..c1ad6cdade13 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PrestoJobOrBuilder.java
@@ -242,7 +242,12 @@ public interface PrestoJobOrBuilder
    * map<string, string> properties = 6 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkBatch.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkBatch.java
index 01199b117b3a..a6d9a0012b68 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkBatch.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkBatch.java
@@ -147,6 +147,8 @@ private PySparkBatch(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJob.java
index 1afcb0432568..b33f558f4f07 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJob.java
@@ -178,6 +178,8 @@ private PySparkJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -652,7 +654,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -696,7 +698,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -717,7 +719,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -2393,7 +2395,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -2437,7 +2439,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2458,7 +2460,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -2486,7 +2488,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -2511,11 +2513,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJobOrBuilder.java
index 89648ac79c6b..4542b0e722dc 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/PySparkJobOrBuilder.java
@@ -391,7 +391,12 @@ public interface PySparkJobOrBuilder
    * map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/QueryList.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/QueryList.java
index 1f47fc8a721c..c1a769478501 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/QueryList.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/QueryList.java
@@ -92,6 +92,8 @@ private QueryList(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegexValidation.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegexValidation.java
index c7d2c2334ec6..a57315eb657c 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegexValidation.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegexValidation.java
@@ -92,6 +92,8 @@ private RegexValidation(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegionName.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegionName.java
index f73d1f21d2c0..7558381f1f68 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegionName.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RegionName.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2021 Google LLC
+ * Copyright 2022 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ReservationAffinity.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ReservationAffinity.java
index 24344364a152..cfdc128d282d 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ReservationAffinity.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ReservationAffinity.java
@@ -108,6 +108,8 @@ private ReservationAffinity(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfig.java
index 4cf2f48a654f..9e33684dd472 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfig.java
@@ -112,6 +112,8 @@ private RuntimeConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -285,7 +287,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -325,7 +327,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -344,7 +346,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -988,7 +990,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1028,7 +1030,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1047,7 +1049,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1073,7 +1075,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1096,11 +1098,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfigOrBuilder.java
index 2b60b9b3daea..f7a1a09d56e0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeConfigOrBuilder.java
@@ -125,7 +125,12 @@ public interface RuntimeConfigOrBuilder
    * map<string, string> properties = 3 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfo.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfo.java
index d8bcda15bb0e..3c8d9edd5358 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfo.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfo.java
@@ -112,6 +112,8 @@ private RuntimeInfo(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -185,7 +187,7 @@ public int getEndpointsCount() {
   @java.lang.Override
   public boolean containsEndpoints(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetEndpoints().getMap().containsKey(key);
   }
@@ -225,7 +227,7 @@ public java.util.Map getEndpointsMap() {
   public java.lang.String getEndpointsOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetEndpoints().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -244,7 +246,7 @@ public java.lang.String getEndpointsOrDefault(
   @java.lang.Override
   public java.lang.String getEndpointsOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetEndpoints().getMap();
     if (!map.containsKey(key)) {
@@ -767,7 +769,7 @@ public int getEndpointsCount() {
     @java.lang.Override
     public boolean containsEndpoints(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetEndpoints().getMap().containsKey(key);
     }
@@ -807,7 +809,7 @@ public java.util.Map getEndpointsMap() {
     public java.lang.String getEndpointsOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetEndpoints().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -826,7 +828,7 @@ public java.lang.String getEndpointsOrDefault(
     @java.lang.Override
     public java.lang.String getEndpointsOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetEndpoints().getMap();
       if (!map.containsKey(key)) {
@@ -852,7 +854,7 @@ public Builder clearEndpoints() {
      */
     public Builder removeEndpoints(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableEndpoints().getMutableMap().remove(key);
       return this;
@@ -875,11 +877,12 @@ public java.util.Map getMutableEndpoints() {
      */
     public Builder putEndpoints(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableEndpoints().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfoOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfoOrBuilder.java
index 0c52ec1c1197..9d8377cbc96d 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfoOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/RuntimeInfoOrBuilder.java
@@ -73,7 +73,12 @@ public interface RuntimeInfoOrBuilder
    * map<string, string> endpoints = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
    * 
    */
-  java.lang.String getEndpointsOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getEndpointsOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SecurityConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SecurityConfig.java
index 1cf38ac7c1f4..a262b7835bf0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SecurityConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SecurityConfig.java
@@ -111,6 +111,8 @@ private SecurityConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ShieldedInstanceConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ShieldedInstanceConfig.java
index 01d8b14f1d54..223e9fe4141b 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ShieldedInstanceConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ShieldedInstanceConfig.java
@@ -95,6 +95,8 @@ private ShieldedInstanceConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfig.java
index dcec205e9190..0bc4e63e45e7 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfig.java
@@ -130,6 +130,8 @@ private SoftwareConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -280,7 +282,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -346,7 +348,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -378,7 +380,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1087,7 +1089,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1153,7 +1155,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1185,7 +1187,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1224,7 +1226,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1260,11 +1262,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfigOrBuilder.java
index 427f89914921..f9f2c6d63004 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfigOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SoftwareConfigOrBuilder.java
@@ -162,7 +162,12 @@ public interface SoftwareConfigOrBuilder
    * map<string, string> properties = 2 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkBatch.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkBatch.java
index 0f00a9d600b8..ca8d9c43a550 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkBatch.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkBatch.java
@@ -140,6 +140,8 @@ private SparkBatch(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkHistoryServerConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkHistoryServerConfig.java
index 309d38841981..5b3c0fbf6bc0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkHistoryServerConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkHistoryServerConfig.java
@@ -88,6 +88,8 @@ private SparkHistoryServerConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJob.java
index eec981387a3e..786f9e660469 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJob.java
@@ -171,6 +171,8 @@ private SparkJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -716,7 +718,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -760,7 +762,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -781,7 +783,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -2469,7 +2471,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -2513,7 +2515,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -2534,7 +2536,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -2562,7 +2564,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -2587,11 +2589,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJobOrBuilder.java
index 4505f5989469..0017ad02fa05 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkJobOrBuilder.java
@@ -386,7 +386,12 @@ public interface SparkJobOrBuilder
    * map<string, string> properties = 7 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRBatch.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRBatch.java
index f694d6178abd..560e8fec4ea5 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRBatch.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRBatch.java
@@ -124,6 +124,8 @@ private SparkRBatch(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJob.java
index 069616e68b8b..3104de022577 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJob.java
@@ -155,6 +155,8 @@ private SparkRJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -493,7 +495,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -537,7 +539,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -558,7 +560,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1813,7 +1815,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1857,7 +1859,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1878,7 +1880,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1906,7 +1908,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1931,11 +1933,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJobOrBuilder.java
index 583317e7a45d..63185648926c 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkRJobOrBuilder.java
@@ -281,7 +281,12 @@ public interface SparkRJobOrBuilder
    * map<string, string> properties = 5 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatch.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatch.java
index 170cbce52d16..e872004bd173 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatch.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatch.java
@@ -118,6 +118,8 @@ private SparkSqlBatch(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -245,7 +247,7 @@ public int getQueryVariablesCount() {
   @java.lang.Override
   public boolean containsQueryVariables(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetQueryVariables().getMap().containsKey(key);
   }
@@ -285,7 +287,7 @@ public java.util.Map getQueryVariablesMap()
   public java.lang.String getQueryVariablesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetQueryVariables().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -304,7 +306,7 @@ public java.lang.String getQueryVariablesOrDefault(
   @java.lang.Override
   public java.lang.String getQueryVariablesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetQueryVariables().getMap();
     if (!map.containsKey(key)) {
@@ -917,7 +919,7 @@ public int getQueryVariablesCount() {
     @java.lang.Override
     public boolean containsQueryVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetQueryVariables().getMap().containsKey(key);
     }
@@ -959,7 +961,7 @@ public java.util.Map getQueryVariablesMap()
     public java.lang.String getQueryVariablesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetQueryVariables().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -979,7 +981,7 @@ public java.lang.String getQueryVariablesOrDefault(
     @java.lang.Override
     public java.lang.String getQueryVariablesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetQueryVariables().getMap();
       if (!map.containsKey(key)) {
@@ -1006,7 +1008,7 @@ public Builder clearQueryVariables() {
      */
     public Builder removeQueryVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableQueryVariables().getMutableMap().remove(key);
       return this;
@@ -1030,11 +1032,12 @@ public java.util.Map getMutableQueryVariable
      */
     public Builder putQueryVariables(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableQueryVariables().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatchOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatchOrBuilder.java
index ed8a233cb113..7d6a521457e3 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatchOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlBatchOrBuilder.java
@@ -98,7 +98,12 @@ public interface SparkSqlBatchOrBuilder
    * map<string, string> query_variables = 2 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getQueryVariablesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getQueryVariablesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJob.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJob.java
index 1a337c178e86..5fb415ab11d6 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJob.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJob.java
@@ -164,6 +164,8 @@ private SparkSqlJob(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -412,7 +414,7 @@ public int getScriptVariablesCount() {
   @java.lang.Override
   public boolean containsScriptVariables(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetScriptVariables().getMap().containsKey(key);
   }
@@ -452,7 +454,7 @@ public java.util.Map getScriptVariablesMap()
   public java.lang.String getScriptVariablesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -471,7 +473,7 @@ public java.lang.String getScriptVariablesOrDefault(
   @java.lang.Override
   public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetScriptVariables().getMap();
     if (!map.containsKey(key)) {
@@ -520,7 +522,7 @@ public int getPropertiesCount() {
   @java.lang.Override
   public boolean containsProperties(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     return internalGetProperties().getMap().containsKey(key);
   }
@@ -562,7 +564,7 @@ public java.util.Map getPropertiesMap() {
   public java.lang.String getPropertiesOrDefault(
       java.lang.String key, java.lang.String defaultValue) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -582,7 +584,7 @@ public java.lang.String getPropertiesOrDefault(
   @java.lang.Override
   public java.lang.String getPropertiesOrThrow(java.lang.String key) {
     if (key == null) {
-      throw new java.lang.NullPointerException();
+      throw new NullPointerException("map key");
     }
     java.util.Map map = internalGetProperties().getMap();
     if (!map.containsKey(key)) {
@@ -1463,8 +1465,9 @@ public Builder mergeQueryList(com.google.cloud.dataproc.v1.QueryList value) {
       } else {
         if (queriesCase_ == 2) {
           queryListBuilder_.mergeFrom(value);
+        } else {
+          queryListBuilder_.setMessage(value);
         }
-        queryListBuilder_.setMessage(value);
       }
       queriesCase_ = 2;
       return this;
@@ -1604,7 +1607,7 @@ public int getScriptVariablesCount() {
     @java.lang.Override
     public boolean containsScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetScriptVariables().getMap().containsKey(key);
     }
@@ -1646,7 +1649,7 @@ public java.util.Map getScriptVariablesMap()
     public java.lang.String getScriptVariablesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1666,7 +1669,7 @@ public java.lang.String getScriptVariablesOrDefault(
     @java.lang.Override
     public java.lang.String getScriptVariablesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetScriptVariables().getMap();
       if (!map.containsKey(key)) {
@@ -1693,7 +1696,7 @@ public Builder clearScriptVariables() {
      */
     public Builder removeScriptVariables(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableScriptVariables().getMutableMap().remove(key);
       return this;
@@ -1717,11 +1720,12 @@ public java.util.Map getMutableScriptVariabl
      */
     public Builder putScriptVariables(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableScriptVariables().getMutableMap().put(key, value);
       return this;
     }
@@ -1785,7 +1789,7 @@ public int getPropertiesCount() {
     @java.lang.Override
     public boolean containsProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       return internalGetProperties().getMap().containsKey(key);
     }
@@ -1827,7 +1831,7 @@ public java.util.Map getPropertiesMap() {
     public java.lang.String getPropertiesOrDefault(
         java.lang.String key, java.lang.String defaultValue) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       return map.containsKey(key) ? map.get(key) : defaultValue;
@@ -1847,7 +1851,7 @@ public java.lang.String getPropertiesOrDefault(
     @java.lang.Override
     public java.lang.String getPropertiesOrThrow(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       java.util.Map map = internalGetProperties().getMap();
       if (!map.containsKey(key)) {
@@ -1874,7 +1878,7 @@ public Builder clearProperties() {
      */
     public Builder removeProperties(java.lang.String key) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       internalGetMutableProperties().getMutableMap().remove(key);
       return this;
@@ -1898,11 +1902,12 @@ public java.util.Map getMutableProperties()
      */
     public Builder putProperties(java.lang.String key, java.lang.String value) {
       if (key == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map key");
       }
       if (value == null) {
-        throw new java.lang.NullPointerException();
+        throw new NullPointerException("map value");
       }
+
       internalGetMutableProperties().getMutableMap().put(key, value);
       return this;
     }
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJobOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJobOrBuilder.java
index 3ba69d141911..5c89007c8880 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJobOrBuilder.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SparkSqlJobOrBuilder.java
@@ -145,7 +145,12 @@ public interface SparkSqlJobOrBuilder
    * map<string, string> script_variables = 3 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getScriptVariablesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getScriptVariablesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
@@ -213,7 +218,12 @@ public interface SparkSqlJobOrBuilder
    * map<string, string> properties = 4 [(.google.api.field_behavior) = OPTIONAL];
    * 
    */
-  java.lang.String getPropertiesOrDefault(java.lang.String key, java.lang.String defaultValue);
+
+  /* nullable */
+  java.lang.String getPropertiesOrDefault(
+      java.lang.String key,
+      /* nullable */
+      java.lang.String defaultValue);
   /**
    *
    *
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StartClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StartClusterRequest.java
index a3f346c9cc92..cbb9dfa8b357 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StartClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StartClusterRequest.java
@@ -120,6 +120,8 @@ private StartClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StopClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StopClusterRequest.java
index 8edd0a3aa73a..2d22eda2b0ec 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StopClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/StopClusterRequest.java
@@ -120,6 +120,8 @@ private StopClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SubmitJobRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SubmitJobRequest.java
index c46e7489b283..d74e447d61a7 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SubmitJobRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/SubmitJobRequest.java
@@ -119,6 +119,8 @@ private SubmitJobRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/TemplateParameter.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/TemplateParameter.java
index 274a900df3f2..eb04309863c3 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/TemplateParameter.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/TemplateParameter.java
@@ -132,6 +132,8 @@ private TemplateParameter(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateAutoscalingPolicyRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateAutoscalingPolicyRequest.java
index 1e68b8c10cf2..7d655b32a5ea 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateAutoscalingPolicyRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateAutoscalingPolicyRequest.java
@@ -96,6 +96,8 @@ private UpdateAutoscalingPolicyRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateClusterRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateClusterRequest.java
index d8ab4c544ae6..8508729be362 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateClusterRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateClusterRequest.java
@@ -158,6 +158,8 @@ private UpdateClusterRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateJobRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateJobRequest.java
index 44377c074bd1..eb84f58a56e0 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateJobRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateJobRequest.java
@@ -134,6 +134,8 @@ private UpdateJobRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateWorkflowTemplateRequest.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateWorkflowTemplateRequest.java
index 65daaf539db6..d3a5117736d9 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateWorkflowTemplateRequest.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/UpdateWorkflowTemplateRequest.java
@@ -95,6 +95,8 @@ private UpdateWorkflowTemplateRequest(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ValueValidation.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ValueValidation.java
index 18e6f1359dd9..beefc815d389 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ValueValidation.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/ValueValidation.java
@@ -92,6 +92,8 @@ private ValueValidation(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfig.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfig.java
index 808a0cc1c3a0..2033228f5552 100644
--- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfig.java
+++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfig.java
@@ -41,7 +41,6 @@ private VirtualClusterConfig(com.google.protobuf.GeneratedMessageV3.Builder b
 
   private VirtualClusterConfig() {
     stagingBucket_ = "";
-    tempBucket_ = "";
   }
 
   @java.lang.Override
@@ -80,13 +79,6 @@ private VirtualClusterConfig(
               stagingBucket_ = s;
               break;
             }
-          case 18:
-            {
-              java.lang.String s = input.readStringRequireUtf8();
-
-              tempBucket_ = s;
-              break;
-            }
           case 50:
             {
               com.google.cloud.dataproc.v1.KubernetesClusterConfig.Builder subBuilder = null;
@@ -135,6 +127,8 @@ private VirtualClusterConfig(
       }
     } catch (com.google.protobuf.InvalidProtocolBufferException e) {
       throw e.setUnfinishedMessage(this);
+    } catch (com.google.protobuf.UninitializedMessageException e) {
+      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
     } catch (java.io.IOException e) {
       throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
     } finally {
@@ -271,79 +265,6 @@ public com.google.protobuf.ByteString getStagingBucketBytes() {
     }
   }
 
-  public static final int TEMP_BUCKET_FIELD_NUMBER = 2;
-  private volatile java.lang.Object tempBucket_;
-  /**
-   *
-   *
-   * 
-   * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-   * such as Spark and MapReduce history files.
-   * If you do not specify a temp bucket,
-   * Dataproc will determine a Cloud Storage location (US,
-   * ASIA, or EU) for your cluster's temp bucket according to the
-   * Compute Engine zone where your cluster is deployed, and then create
-   * and manage this project-level, per-location bucket. The default bucket has
-   * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-   * bucket (see
-   * [Dataproc staging and temp
-   * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-   * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-   * a Cloud Storage bucket.**
-   * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The tempBucket. - */ - @java.lang.Override - public java.lang.String getTempBucket() { - java.lang.Object ref = tempBucket_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tempBucket_ = s; - return s; - } - } - /** - * - * - *
-   * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-   * such as Spark and MapReduce history files.
-   * If you do not specify a temp bucket,
-   * Dataproc will determine a Cloud Storage location (US,
-   * ASIA, or EU) for your cluster's temp bucket according to the
-   * Compute Engine zone where your cluster is deployed, and then create
-   * and manage this project-level, per-location bucket. The default bucket has
-   * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-   * bucket (see
-   * [Dataproc staging and temp
-   * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-   * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-   * a Cloud Storage bucket.**
-   * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for tempBucket. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTempBucketBytes() { - java.lang.Object ref = tempBucket_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - tempBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int KUBERNETES_CLUSTER_CONFIG_FIELD_NUMBER = 6; /** * @@ -474,9 +395,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stagingBucket_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stagingBucket_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tempBucket_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tempBucket_); - } if (infrastructureConfigCase_ == 6) { output.writeMessage( 6, (com.google.cloud.dataproc.v1.KubernetesClusterConfig) infrastructureConfig_); @@ -496,9 +414,6 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(stagingBucket_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, stagingBucket_); } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tempBucket_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tempBucket_); - } if (infrastructureConfigCase_ == 6) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -525,7 +440,6 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.dataproc.v1.VirtualClusterConfig) obj; if (!getStagingBucket().equals(other.getStagingBucket())) return false; - if (!getTempBucket().equals(other.getTempBucket())) return false; if (hasAuxiliaryServicesConfig() != other.hasAuxiliaryServicesConfig()) return false; if (hasAuxiliaryServicesConfig()) { if (!getAuxiliaryServicesConfig().equals(other.getAuxiliaryServicesConfig())) return false; @@ -551,8 +465,6 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + STAGING_BUCKET_FIELD_NUMBER; hash = (53 * hash) + getStagingBucket().hashCode(); - hash = (37 * hash) + TEMP_BUCKET_FIELD_NUMBER; - hash = (53 * hash) + getTempBucket().hashCode(); if (hasAuxiliaryServicesConfig()) { hash = (37 * hash) + AUXILIARY_SERVICES_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getAuxiliaryServicesConfig().hashCode(); @@ -714,8 +626,6 @@ public Builder clear() { super.clear(); stagingBucket_ = ""; - tempBucket_ = ""; - if (auxiliaryServicesConfigBuilder_ == null) { auxiliaryServicesConfig_ = null; } else { @@ -752,7 +662,6 @@ public com.google.cloud.dataproc.v1.VirtualClusterConfig buildPartial() { com.google.cloud.dataproc.v1.VirtualClusterConfig result = new com.google.cloud.dataproc.v1.VirtualClusterConfig(this); result.stagingBucket_ = stagingBucket_; - result.tempBucket_ = tempBucket_; if (infrastructureConfigCase_ == 6) { if (kubernetesClusterConfigBuilder_ == null) { result.infrastructureConfig_ = infrastructureConfig_; @@ -820,10 +729,6 @@ public Builder mergeFrom(com.google.cloud.dataproc.v1.VirtualClusterConfig other stagingBucket_ = other.stagingBucket_; onChanged(); } - if (!other.getTempBucket().isEmpty()) { - tempBucket_ = other.tempBucket_; - onChanged(); - } if (other.hasAuxiliaryServicesConfig()) { mergeAuxiliaryServicesConfig(other.getAuxiliaryServicesConfig()); } @@ -1038,172 +943,6 @@ public Builder setStagingBucketBytes(com.google.protobuf.ByteString value) { return this; } - private java.lang.Object tempBucket_ = ""; - /** - * - * - *
-     * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-     * such as Spark and MapReduce history files.
-     * If you do not specify a temp bucket,
-     * Dataproc will determine a Cloud Storage location (US,
-     * ASIA, or EU) for your cluster's temp bucket according to the
-     * Compute Engine zone where your cluster is deployed, and then create
-     * and manage this project-level, per-location bucket. The default bucket has
-     * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-     * bucket (see
-     * [Dataproc staging and temp
-     * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-     * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-     * a Cloud Storage bucket.**
-     * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The tempBucket. - */ - public java.lang.String getTempBucket() { - java.lang.Object ref = tempBucket_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - tempBucket_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-     * such as Spark and MapReduce history files.
-     * If you do not specify a temp bucket,
-     * Dataproc will determine a Cloud Storage location (US,
-     * ASIA, or EU) for your cluster's temp bucket according to the
-     * Compute Engine zone where your cluster is deployed, and then create
-     * and manage this project-level, per-location bucket. The default bucket has
-     * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-     * bucket (see
-     * [Dataproc staging and temp
-     * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-     * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-     * a Cloud Storage bucket.**
-     * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for tempBucket. - */ - public com.google.protobuf.ByteString getTempBucketBytes() { - java.lang.Object ref = tempBucket_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - tempBucket_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-     * such as Spark and MapReduce history files.
-     * If you do not specify a temp bucket,
-     * Dataproc will determine a Cloud Storage location (US,
-     * ASIA, or EU) for your cluster's temp bucket according to the
-     * Compute Engine zone where your cluster is deployed, and then create
-     * and manage this project-level, per-location bucket. The default bucket has
-     * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-     * bucket (see
-     * [Dataproc staging and temp
-     * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-     * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-     * a Cloud Storage bucket.**
-     * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The tempBucket to set. - * @return This builder for chaining. - */ - public Builder setTempBucket(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - tempBucket_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-     * such as Spark and MapReduce history files.
-     * If you do not specify a temp bucket,
-     * Dataproc will determine a Cloud Storage location (US,
-     * ASIA, or EU) for your cluster's temp bucket according to the
-     * Compute Engine zone where your cluster is deployed, and then create
-     * and manage this project-level, per-location bucket. The default bucket has
-     * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-     * bucket (see
-     * [Dataproc staging and temp
-     * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-     * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-     * a Cloud Storage bucket.**
-     * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return This builder for chaining. - */ - public Builder clearTempBucket() { - - tempBucket_ = getDefaultInstance().getTempBucket(); - onChanged(); - return this; - } - /** - * - * - *
-     * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-     * such as Spark and MapReduce history files.
-     * If you do not specify a temp bucket,
-     * Dataproc will determine a Cloud Storage location (US,
-     * ASIA, or EU) for your cluster's temp bucket according to the
-     * Compute Engine zone where your cluster is deployed, and then create
-     * and manage this project-level, per-location bucket. The default bucket has
-     * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-     * bucket (see
-     * [Dataproc staging and temp
-     * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-     * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-     * a Cloud Storage bucket.**
-     * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @param value The bytes for tempBucket to set. - * @return This builder for chaining. - */ - public Builder setTempBucketBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - tempBucket_ = value; - onChanged(); - return this; - } - private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dataproc.v1.KubernetesClusterConfig, com.google.cloud.dataproc.v1.KubernetesClusterConfig.Builder, @@ -1329,8 +1068,9 @@ public Builder mergeKubernetesClusterConfig( } else { if (infrastructureConfigCase_ == 6) { kubernetesClusterConfigBuilder_.mergeFrom(value); + } else { + kubernetesClusterConfigBuilder_.setMessage(value); } - kubernetesClusterConfigBuilder_.setMessage(value); } infrastructureConfigCase_ = 6; return this; diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfigOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfigOrBuilder.java index cd4563e8c671..83736cd245d7 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfigOrBuilder.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/VirtualClusterConfigOrBuilder.java @@ -68,55 +68,6 @@ public interface VirtualClusterConfigOrBuilder */ com.google.protobuf.ByteString getStagingBucketBytes(); - /** - * - * - *
-   * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-   * such as Spark and MapReduce history files.
-   * If you do not specify a temp bucket,
-   * Dataproc will determine a Cloud Storage location (US,
-   * ASIA, or EU) for your cluster's temp bucket according to the
-   * Compute Engine zone where your cluster is deployed, and then create
-   * and manage this project-level, per-location bucket. The default bucket has
-   * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-   * bucket (see
-   * [Dataproc staging and temp
-   * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-   * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-   * a Cloud Storage bucket.**
-   * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The tempBucket. - */ - java.lang.String getTempBucket(); - /** - * - * - *
-   * Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
-   * such as Spark and MapReduce history files.
-   * If you do not specify a temp bucket,
-   * Dataproc will determine a Cloud Storage location (US,
-   * ASIA, or EU) for your cluster's temp bucket according to the
-   * Compute Engine zone where your cluster is deployed, and then create
-   * and manage this project-level, per-location bucket. The default bucket has
-   * a TTL of 90 days, but you can use any TTL (or none) if you specify a
-   * bucket (see
-   * [Dataproc staging and temp
-   * buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
-   * **This field requires a Cloud Storage bucket name, not a `gs://...` URI to
-   * a Cloud Storage bucket.**
-   * 
- * - * string temp_bucket = 2 [(.google.api.field_behavior) = OPTIONAL]; - * - * @return The bytes for tempBucket. - */ - com.google.protobuf.ByteString getTempBucketBytes(); - /** * * diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowGraph.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowGraph.java index 48b82a3db861..0407748d1245 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowGraph.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowGraph.java @@ -93,6 +93,8 @@ private WorkflowGraph( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadata.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadata.java index 81adc0ed6082..d0ab53e1d437 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadata.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadata.java @@ -256,6 +256,8 @@ private WorkflowMetadata( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { @@ -841,7 +843,7 @@ public int getParametersCount() { @java.lang.Override public boolean containsParameters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } return internalGetParameters().getMap().containsKey(key); } @@ -877,7 +879,7 @@ public java.util.Map getParametersMap() { public java.lang.String getParametersOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetParameters().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -894,7 +896,7 @@ public java.lang.String getParametersOrDefault( @java.lang.Override public java.lang.String getParametersOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetParameters().getMap(); if (!map.containsKey(key)) { @@ -2916,7 +2918,7 @@ public int getParametersCount() { @java.lang.Override public boolean containsParameters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } return internalGetParameters().getMap().containsKey(key); } @@ -2952,7 +2954,7 @@ public java.util.Map getParametersMap() { public java.lang.String getParametersOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetParameters().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -2969,7 +2971,7 @@ public java.lang.String getParametersOrDefault( @java.lang.Override public java.lang.String getParametersOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetParameters().getMap(); if (!map.containsKey(key)) { @@ -2993,7 +2995,7 @@ public Builder clearParameters() { */ public Builder removeParameters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } internalGetMutableParameters().getMutableMap().remove(key); return this; @@ -3014,11 +3016,12 @@ public java.util.Map getMutableParameters() */ public Builder putParameters(java.lang.String key, java.lang.String value) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } if (value == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map value"); } + internalGetMutableParameters().getMutableMap().put(key, value); return this; } diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadataOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadataOrBuilder.java index c6c1db05c447..f015e14e20db 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadataOrBuilder.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowMetadataOrBuilder.java @@ -295,7 +295,12 @@ public interface WorkflowMetadataOrBuilder * * map<string, string> parameters = 8; */ - java.lang.String getParametersOrDefault(java.lang.String key, java.lang.String defaultValue); + + /* nullable */ + java.lang.String getParametersOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); /** * * diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowNode.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowNode.java index 445865f92759..a93bdbdf7877 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowNode.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowNode.java @@ -124,6 +124,8 @@ private WorkflowNode( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplate.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplate.java index 280f0bb4589b..6e738fc99b85 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplate.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplate.java @@ -202,6 +202,8 @@ private WorkflowTemplate( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { @@ -510,7 +512,7 @@ public int getLabelsCount() { @java.lang.Override public boolean containsLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } return internalGetLabels().getMap().containsKey(key); } @@ -561,7 +563,7 @@ public java.util.Map getLabelsMap() { @java.lang.Override public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -586,7 +588,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { @@ -2242,7 +2244,7 @@ public int getLabelsCount() { @java.lang.Override public boolean containsLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } return internalGetLabels().getMap().containsKey(key); } @@ -2294,7 +2296,7 @@ public java.util.Map getLabelsMap() { public java.lang.String getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; @@ -2319,7 +2321,7 @@ public java.lang.String getLabelsOrDefault( @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { @@ -2351,7 +2353,7 @@ public Builder clearLabels() { */ public Builder removeLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } internalGetMutableLabels().getMutableMap().remove(key); return this; @@ -2380,11 +2382,12 @@ public java.util.Map getMutableLabels() { */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } if (value == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map value"); } + internalGetMutableLabels().getMutableMap().put(key, value); return this; } diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java index 6bbd109d8f71..21925bca9fad 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateName.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateOrBuilder.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateOrBuilder.java index 5ad42f180719..5e314eb2a9c7 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateOrBuilder.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateOrBuilder.java @@ -245,7 +245,12 @@ public interface WorkflowTemplateOrBuilder * * map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); /** * * diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplatePlacement.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplatePlacement.java index 849040ecdd09..5aff8f21408a 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplatePlacement.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplatePlacement.java @@ -113,6 +113,8 @@ private WorkflowTemplatePlacement( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { @@ -793,8 +795,9 @@ public Builder mergeManagedCluster(com.google.cloud.dataproc.v1.ManagedCluster v } else { if (placementCase_ == 1) { managedClusterBuilder_.mergeFrom(value); + } else { + managedClusterBuilder_.setMessage(value); } - managedClusterBuilder_.setMessage(value); } placementCase_ = 1; return this; @@ -1012,8 +1015,9 @@ public Builder mergeClusterSelector(com.google.cloud.dataproc.v1.ClusterSelector } else { if (placementCase_ == 2) { clusterSelectorBuilder_.mergeFrom(value); + } else { + clusterSelectorBuilder_.setMessage(value); } - clusterSelectorBuilder_.setMessage(value); } placementCase_ = 2; return this; diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/YarnApplication.java b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/YarnApplication.java index e7f0c676ccff..92fca525cc5f 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/YarnApplication.java +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/java/com/google/cloud/dataproc/v1/YarnApplication.java @@ -112,6 +112,8 @@ private YarnApplication( } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { @@ -610,7 +612,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.dataproc.v1.YarnApplication.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(2, state_); } - if (progress_ != 0F) { + if (java.lang.Float.floatToRawIntBits(progress_) != 0) { output.writeFloat(3, progress_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trackingUrl_)) { @@ -632,7 +634,7 @@ public int getSerializedSize() { != com.google.cloud.dataproc.v1.YarnApplication.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, state_); } - if (progress_ != 0F) { + if (java.lang.Float.floatToRawIntBits(progress_) != 0) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, progress_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trackingUrl_)) { diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto index 94b225a47afe..18b2f7df36df 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/autoscaling_policies.proto @@ -153,8 +153,10 @@ message AutoscalingPolicy { // Basic algorithm for autoscaling. message BasicAutoscalingAlgorithm { - // Required. YARN autoscaling configuration. - BasicYarnAutoscalingConfig yarn_config = 1 [(google.api.field_behavior) = REQUIRED]; + oneof config { + // Required. YARN autoscaling configuration. + BasicYarnAutoscalingConfig yarn_config = 1 [(google.api.field_behavior) = REQUIRED]; + } // Optional. Duration between scaling events. A scaling period starts after // the update operation from the previous event has completed. diff --git a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/clusters.proto b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/clusters.proto index 0b9f0a029723..2b650c135836 100644 --- a/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/clusters.proto +++ b/java-dataproc/proto-google-cloud-dataproc-v1/src/main/proto/google/cloud/dataproc/v1/clusters.proto @@ -303,21 +303,6 @@ message VirtualClusterConfig { // a Cloud Storage bucket.** string staging_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data, - // such as Spark and MapReduce history files. - // If you do not specify a temp bucket, - // Dataproc will determine a Cloud Storage location (US, - // ASIA, or EU) for your cluster's temp bucket according to the - // Compute Engine zone where your cluster is deployed, and then create - // and manage this project-level, per-location bucket. The default bucket has - // a TTL of 90 days, but you can use any TTL (or none) if you specify a - // bucket (see - // [Dataproc staging and temp - // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). - // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - // a Cloud Storage bucket.** - string temp_bucket = 2 [(google.api.field_behavior) = OPTIONAL]; - oneof infrastructure_config { // Required. The configuration for running the Dataproc cluster on Kubernetes. KubernetesClusterConfig kubernetes_cluster_config = 6 [(google.api.field_behavior) = REQUIRED]; diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..62e0ffa8ac61 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceSettings; +import com.google.cloud.dataproc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = + AutoscalingPolicyServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings); + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_create_setcredentialsprovider_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider1.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..29234b180d53 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = + AutoscalingPolicyServiceSettings.newBuilder() + .setTransportChannelProvider( + AutoscalingPolicyServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings); + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_create_setcredentialsprovider1_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetEndpoint.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..605bda4dbe44 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_create_setendpoint_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceSettings; +import com.google.cloud.dataproc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = + AutoscalingPolicyServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create(autoscalingPolicyServiceSettings); + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_create_setendpoint_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/AsyncCreateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/AsyncCreateAutoscalingPolicy.java new file mode 100644 index 000000000000..0f089a3b6c4a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/AsyncCreateAutoscalingPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class AsyncCreateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + asyncCreateAutoscalingPolicy(); + } + + public static void asyncCreateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + CreateAutoscalingPolicyRequest request = + CreateAutoscalingPolicyRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPolicy(AutoscalingPolicy.newBuilder().build()) + .build(); + ApiFuture future = + autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request); + // Do something. + AutoscalingPolicy response = future.get(); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java new file mode 100644 index 000000000000..2b81972cd2cf --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicy(); + } + + public static void syncCreateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + CreateAutoscalingPolicyRequest request = + CreateAutoscalingPolicyRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPolicy(AutoscalingPolicy.newBuilder().build()) + .build(); + AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(request); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyLocationnameAutoscalingpolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyLocationnameAutoscalingpolicy.java new file mode 100644 index 000000000000..b945d3f9ad9b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyLocationnameAutoscalingpolicy.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_locationnameautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateAutoscalingPolicyLocationnameAutoscalingpolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicyLocationnameAutoscalingpolicy(); + } + + public static void syncCreateAutoscalingPolicyLocationnameAutoscalingpolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + AutoscalingPolicy response = + autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_locationnameautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyRegionnameAutoscalingpolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyRegionnameAutoscalingpolicy.java new file mode 100644 index 000000000000..46aebc7c7154 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyRegionnameAutoscalingpolicy.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_regionnameautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.RegionName; + +public class SyncCreateAutoscalingPolicyRegionnameAutoscalingpolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicyRegionnameAutoscalingpolicy(); + } + + public static void syncCreateAutoscalingPolicyRegionnameAutoscalingpolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + AutoscalingPolicy response = + autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_regionnameautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyStringAutoscalingpolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyStringAutoscalingpolicy.java new file mode 100644 index 000000000000..2300f67b6551 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/createautoscalingpolicy/SyncCreateAutoscalingPolicyStringAutoscalingpolicy.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_stringautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateAutoscalingPolicyStringAutoscalingpolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicyStringAutoscalingpolicy(); + } + + public static void syncCreateAutoscalingPolicyStringAutoscalingpolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + AutoscalingPolicy response = + autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_createautoscalingpolicy_stringautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/AsyncDeleteAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/AsyncDeleteAutoscalingPolicy.java new file mode 100644 index 000000000000..bc4ffec24845 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/AsyncDeleteAutoscalingPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + asyncDeleteAutoscalingPolicy(); + } + + public static void asyncDeleteAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + DeleteAutoscalingPolicyRequest request = + DeleteAutoscalingPolicyRequest.newBuilder() + .setName( + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString()) + .build(); + ApiFuture future = + autoscalingPolicyServiceClient.deleteAutoscalingPolicyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicy.java new file mode 100644 index 000000000000..ff83b8b23f2e --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicy.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; + +public class SyncDeleteAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncDeleteAutoscalingPolicy(); + } + + public static void syncDeleteAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + DeleteAutoscalingPolicyRequest request = + DeleteAutoscalingPolicyRequest.newBuilder() + .setName( + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString()) + .build(); + autoscalingPolicyServiceClient.deleteAutoscalingPolicy(request); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyAutoscalingpolicyname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyAutoscalingpolicyname.java new file mode 100644 index 000000000000..9dc278cb74b1 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyAutoscalingpolicyname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_autoscalingpolicyname_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; + +public class SyncDeleteAutoscalingPolicyAutoscalingpolicyname { + + public static void main(String[] args) throws Exception { + syncDeleteAutoscalingPolicyAutoscalingpolicyname(); + } + + public static void syncDeleteAutoscalingPolicyAutoscalingpolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + AutoscalingPolicyName name = + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_autoscalingpolicyname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyString.java new file mode 100644 index 000000000000..d0c0a8a31fdd --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/deleteautoscalingpolicy/SyncDeleteAutoscalingPolicyString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_string_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; + +public class SyncDeleteAutoscalingPolicyString { + + public static void main(String[] args) throws Exception { + syncDeleteAutoscalingPolicyString(); + } + + public static void syncDeleteAutoscalingPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + String name = + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString(); + autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_deleteautoscalingpolicy_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/AsyncGetAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/AsyncGetAutoscalingPolicy.java new file mode 100644 index 000000000000..007848230844 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/AsyncGetAutoscalingPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + +public class AsyncGetAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + asyncGetAutoscalingPolicy(); + } + + public static void asyncGetAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + GetAutoscalingPolicyRequest request = + GetAutoscalingPolicyRequest.newBuilder() + .setName( + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString()) + .build(); + ApiFuture future = + autoscalingPolicyServiceClient.getAutoscalingPolicyCallable().futureCall(request); + // Do something. + AutoscalingPolicy response = future.get(); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicy.java new file mode 100644 index 000000000000..3e05d1c4c612 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + +public class SyncGetAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncGetAutoscalingPolicy(); + } + + public static void syncGetAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + GetAutoscalingPolicyRequest request = + GetAutoscalingPolicyRequest.newBuilder() + .setName( + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString()) + .build(); + AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(request); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyAutoscalingpolicyname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyAutoscalingpolicyname.java new file mode 100644 index 000000000000..b25f80b6d4f1 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyAutoscalingpolicyname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_autoscalingpolicyname_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; + +public class SyncGetAutoscalingPolicyAutoscalingpolicyname { + + public static void main(String[] args) throws Exception { + syncGetAutoscalingPolicyAutoscalingpolicyname(); + } + + public static void syncGetAutoscalingPolicyAutoscalingpolicyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + AutoscalingPolicyName name = + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_autoscalingpolicyname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyString.java new file mode 100644 index 000000000000..da79dbb9ef82 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/getautoscalingpolicy/SyncGetAutoscalingPolicyString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_string_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyName; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; + +public class SyncGetAutoscalingPolicyString { + + public static void main(String[] args) throws Exception { + syncGetAutoscalingPolicyString(); + } + + public static void syncGetAutoscalingPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + String name = + AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + .toString(); + AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_getautoscalingpolicy_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPolicies.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPolicies.java new file mode 100644 index 000000000000..c0c5dcb898e7 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPolicies.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class AsyncListAutoscalingPolicies { + + public static void main(String[] args) throws Exception { + asyncListAutoscalingPolicies(); + } + + public static void asyncListAutoscalingPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + ListAutoscalingPoliciesRequest request = + ListAutoscalingPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + autoscalingPolicyServiceClient.listAutoscalingPoliciesPagedCallable().futureCall(request); + // Do something. + for (AutoscalingPolicy element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPoliciesPaged.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPoliciesPaged.java new file mode 100644 index 000000000000..644690ba9eba --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/AsyncListAutoscalingPoliciesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_paged_async] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; +import com.google.cloud.dataproc.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListAutoscalingPoliciesPaged { + + public static void main(String[] args) throws Exception { + asyncListAutoscalingPoliciesPaged(); + } + + public static void asyncListAutoscalingPoliciesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + ListAutoscalingPoliciesRequest request = + ListAutoscalingPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListAutoscalingPoliciesResponse response = + autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request); + for (AutoscalingPolicy element : response.getPoliciesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_paged_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPolicies.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPolicies.java new file mode 100644 index 000000000000..e3c92d37fadb --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPolicies.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListAutoscalingPolicies { + + public static void main(String[] args) throws Exception { + syncListAutoscalingPolicies(); + } + + public static void syncListAutoscalingPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + ListAutoscalingPoliciesRequest request = + ListAutoscalingPoliciesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (AutoscalingPolicy element : + autoscalingPolicyServiceClient.listAutoscalingPolicies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesLocationname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesLocationname.java new file mode 100644 index 000000000000..b38cfb053b2b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesLocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_locationname_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListAutoscalingPoliciesLocationname { + + public static void main(String[] args) throws Exception { + syncListAutoscalingPoliciesLocationname(); + } + + public static void syncListAutoscalingPoliciesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (AutoscalingPolicy element : + autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_locationname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesRegionname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesRegionname.java new file mode 100644 index 000000000000..97baf7e317b8 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesRegionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_regionname_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.RegionName; + +public class SyncListAutoscalingPoliciesRegionname { + + public static void main(String[] args) throws Exception { + syncListAutoscalingPoliciesRegionname(); + } + + public static void syncListAutoscalingPoliciesRegionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + for (AutoscalingPolicy element : + autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_regionname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesString.java new file mode 100644 index 000000000000..ffdcb024e459 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/listautoscalingpolicies/SyncListAutoscalingPoliciesString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_string_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListAutoscalingPoliciesString { + + public static void main(String[] args) throws Exception { + syncListAutoscalingPoliciesString(); + } + + public static void syncListAutoscalingPoliciesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (AutoscalingPolicy element : + autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/AsyncUpdateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/AsyncUpdateAutoscalingPolicy.java new file mode 100644 index 000000000000..960be01b6835 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/AsyncUpdateAutoscalingPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + +public class AsyncUpdateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + asyncUpdateAutoscalingPolicy(); + } + + public static void asyncUpdateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + UpdateAutoscalingPolicyRequest request = + UpdateAutoscalingPolicyRequest.newBuilder() + .setPolicy(AutoscalingPolicy.newBuilder().build()) + .build(); + ApiFuture future = + autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request); + // Do something. + AutoscalingPolicy response = future.get(); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicy.java new file mode 100644 index 000000000000..853d38886dd0 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicy.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; +import com.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + +public class SyncUpdateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncUpdateAutoscalingPolicy(); + } + + public static void syncUpdateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + UpdateAutoscalingPolicyRequest request = + UpdateAutoscalingPolicyRequest.newBuilder() + .setPolicy(AutoscalingPolicy.newBuilder().build()) + .build(); + AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(request); + } + } +} +// [END dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicyAutoscalingpolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicyAutoscalingpolicy.java new file mode 100644 index 000000000000..a73a146323dd --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyserviceclient/updateautoscalingpolicy/SyncUpdateAutoscalingPolicyAutoscalingpolicy.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_autoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicy; +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient; + +public class SyncUpdateAutoscalingPolicyAutoscalingpolicy { + + public static void main(String[] args) throws Exception { + syncUpdateAutoscalingPolicyAutoscalingpolicy(); + } + + public static void syncUpdateAutoscalingPolicyAutoscalingpolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + AutoscalingPolicyServiceClient.create()) { + AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy); + } + } +} +// [END +// dataproc_v1_generated_autoscalingpolicyserviceclient_updateautoscalingpolicy_autoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyservicesettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyservicesettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java new file mode 100644 index 000000000000..afc5ad757f04 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/autoscalingpolicyservicesettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_autoscalingpolicyservicesettings_createautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceSettings; +import java.time.Duration; + +public class SyncCreateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicy(); + } + + public static void syncCreateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder = + AutoscalingPolicyServiceSettings.newBuilder(); + autoscalingPolicyServiceSettingsBuilder + .createAutoscalingPolicySettings() + .setRetrySettings( + autoscalingPolicyServiceSettingsBuilder + .createAutoscalingPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = + autoscalingPolicyServiceSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_autoscalingpolicyservicesettings_createautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..0373f3a6293c --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchControllerSettings; +import com.google.cloud.dataproc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BatchControllerSettings batchControllerSettings = + BatchControllerSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + BatchControllerClient batchControllerClient = + BatchControllerClient.create(batchControllerSettings); + } +} +// [END dataproc_v1_generated_batchcontrollerclient_create_setcredentialsprovider_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider1.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..99b4414b88f2 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchControllerSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BatchControllerSettings batchControllerSettings = + BatchControllerSettings.newBuilder() + .setTransportChannelProvider( + BatchControllerSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + BatchControllerClient batchControllerClient = + BatchControllerClient.create(batchControllerSettings); + } +} +// [END dataproc_v1_generated_batchcontrollerclient_create_setcredentialsprovider1_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetEndpoint.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..0377155de181 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_create_setendpoint_sync] +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchControllerSettings; +import com.google.cloud.dataproc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BatchControllerSettings batchControllerSettings = + BatchControllerSettings.newBuilder().setEndpoint(myEndpoint).build(); + BatchControllerClient batchControllerClient = + BatchControllerClient.create(batchControllerSettings); + } +} +// [END dataproc_v1_generated_batchcontrollerclient_create_setendpoint_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatch.java new file mode 100644 index 000000000000..839fea7cdf71 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatch.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_createbatch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.CreateBatchRequest; +import com.google.cloud.dataproc.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateBatch { + + public static void main(String[] args) throws Exception { + asyncCreateBatch(); + } + + public static void asyncCreateBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + CreateBatchRequest request = + CreateBatchRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBatch(Batch.newBuilder().build()) + .setBatchId("batchId-331744779") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = batchControllerClient.createBatchCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_createbatch_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatchLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatchLRO.java new file mode 100644 index 000000000000..0f98a0aba7c6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/AsyncCreateBatchLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_createbatch_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchOperationMetadata; +import com.google.cloud.dataproc.v1.CreateBatchRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class AsyncCreateBatchLRO { + + public static void main(String[] args) throws Exception { + asyncCreateBatchLRO(); + } + + public static void asyncCreateBatchLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + CreateBatchRequest request = + CreateBatchRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBatch(Batch.newBuilder().build()) + .setBatchId("batchId-331744779") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + batchControllerClient.createBatchOperationCallable().futureCall(request); + // Do something. + Batch response = future.get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_createbatch_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatch.java new file mode 100644 index 000000000000..17e8e588734b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatch.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_createbatch_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.CreateBatchRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateBatch { + + public static void main(String[] args) throws Exception { + syncCreateBatch(); + } + + public static void syncCreateBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + CreateBatchRequest request = + CreateBatchRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBatch(Batch.newBuilder().build()) + .setBatchId("batchId-331744779") + .setRequestId("requestId693933066") + .build(); + Batch response = batchControllerClient.createBatchAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_createbatch_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchLocationnameBatchString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchLocationnameBatchString.java new file mode 100644 index 000000000000..508180fdfc18 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchLocationnameBatchString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_createbatch_locationnamebatchstring_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateBatchLocationnameBatchString { + + public static void main(String[] args) throws Exception { + syncCreateBatchLocationnameBatchString(); + } + + public static void syncCreateBatchLocationnameBatchString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Batch batch = Batch.newBuilder().build(); + String batchId = "batchId-331744779"; + Batch response = batchControllerClient.createBatchAsync(parent, batch, batchId).get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_createbatch_locationnamebatchstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchStringBatchString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchStringBatchString.java new file mode 100644 index 000000000000..2793e455db84 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/createbatch/SyncCreateBatchStringBatchString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_createbatch_stringbatchstring_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncCreateBatchStringBatchString { + + public static void main(String[] args) throws Exception { + syncCreateBatchStringBatchString(); + } + + public static void syncCreateBatchStringBatchString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Batch batch = Batch.newBuilder().build(); + String batchId = "batchId-331744779"; + Batch response = batchControllerClient.createBatchAsync(parent, batch, batchId).get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_createbatch_stringbatchstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/AsyncDeleteBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/AsyncDeleteBatch.java new file mode 100644 index 000000000000..cd0e119e5ef6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/AsyncDeleteBatch.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_deletebatch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; +import com.google.cloud.dataproc.v1.DeleteBatchRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteBatch { + + public static void main(String[] args) throws Exception { + asyncDeleteBatch(); + } + + public static void asyncDeleteBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + DeleteBatchRequest request = + DeleteBatchRequest.newBuilder() + .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString()) + .build(); + ApiFuture future = batchControllerClient.deleteBatchCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_deletebatch_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatch.java new file mode 100644 index 000000000000..8b73d560e5cb --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatch.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_deletebatch_sync] +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; +import com.google.cloud.dataproc.v1.DeleteBatchRequest; + +public class SyncDeleteBatch { + + public static void main(String[] args) throws Exception { + syncDeleteBatch(); + } + + public static void syncDeleteBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + DeleteBatchRequest request = + DeleteBatchRequest.newBuilder() + .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString()) + .build(); + batchControllerClient.deleteBatch(request); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_deletebatch_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchBatchname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchBatchname.java new file mode 100644 index 000000000000..4dda92f8f72d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchBatchname.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_deletebatch_batchname_sync] +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; + +public class SyncDeleteBatchBatchname { + + public static void main(String[] args) throws Exception { + syncDeleteBatchBatchname(); + } + + public static void syncDeleteBatchBatchname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]"); + batchControllerClient.deleteBatch(name); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_deletebatch_batchname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchString.java new file mode 100644 index 000000000000..490094e5913a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/deletebatch/SyncDeleteBatchString.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_deletebatch_string_sync] +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; + +public class SyncDeleteBatchString { + + public static void main(String[] args) throws Exception { + syncDeleteBatchString(); + } + + public static void syncDeleteBatchString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + String name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString(); + batchControllerClient.deleteBatch(name); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_deletebatch_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/AsyncGetBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/AsyncGetBatch.java new file mode 100644 index 000000000000..5405d3a8534f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/AsyncGetBatch.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_getbatch_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; +import com.google.cloud.dataproc.v1.GetBatchRequest; + +public class AsyncGetBatch { + + public static void main(String[] args) throws Exception { + asyncGetBatch(); + } + + public static void asyncGetBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + GetBatchRequest request = + GetBatchRequest.newBuilder() + .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString()) + .build(); + ApiFuture future = batchControllerClient.getBatchCallable().futureCall(request); + // Do something. + Batch response = future.get(); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_getbatch_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatch.java new file mode 100644 index 000000000000..26e423cb1979 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatch.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_getbatch_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; +import com.google.cloud.dataproc.v1.GetBatchRequest; + +public class SyncGetBatch { + + public static void main(String[] args) throws Exception { + syncGetBatch(); + } + + public static void syncGetBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + GetBatchRequest request = + GetBatchRequest.newBuilder() + .setName(BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString()) + .build(); + Batch response = batchControllerClient.getBatch(request); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_getbatch_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchBatchname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchBatchname.java new file mode 100644 index 000000000000..5fe46c90b34a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchBatchname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_getbatch_batchname_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; + +public class SyncGetBatchBatchname { + + public static void main(String[] args) throws Exception { + syncGetBatchBatchname(); + } + + public static void syncGetBatchBatchname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + BatchName name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]"); + Batch response = batchControllerClient.getBatch(name); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_getbatch_batchname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchString.java new file mode 100644 index 000000000000..a47944e4d199 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/getbatch/SyncGetBatchString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_getbatch_string_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.BatchName; + +public class SyncGetBatchString { + + public static void main(String[] args) throws Exception { + syncGetBatchString(); + } + + public static void syncGetBatchString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + String name = BatchName.of("[PROJECT]", "[LOCATION]", "[BATCH]").toString(); + Batch response = batchControllerClient.getBatch(name); + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_getbatch_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatches.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatches.java new file mode 100644 index 000000000000..ccb2e46eb6a2 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatches.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_listbatches_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.ListBatchesRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class AsyncListBatches { + + public static void main(String[] args) throws Exception { + asyncListBatches(); + } + + public static void asyncListBatches() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + ListBatchesRequest request = + ListBatchesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + batchControllerClient.listBatchesPagedCallable().futureCall(request); + // Do something. + for (Batch element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_listbatches_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatchesPaged.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatchesPaged.java new file mode 100644 index 000000000000..06e83f3b6482 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/AsyncListBatchesPaged.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_listbatches_paged_async] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.ListBatchesRequest; +import com.google.cloud.dataproc.v1.ListBatchesResponse; +import com.google.cloud.dataproc.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListBatchesPaged { + + public static void main(String[] args) throws Exception { + asyncListBatchesPaged(); + } + + public static void asyncListBatchesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + ListBatchesRequest request = + ListBatchesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListBatchesResponse response = batchControllerClient.listBatchesCallable().call(request); + for (Batch element : response.getBatchesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_listbatches_paged_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatches.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatches.java new file mode 100644 index 000000000000..b8f07cbf975a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatches.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_listbatches_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.ListBatchesRequest; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListBatches { + + public static void main(String[] args) throws Exception { + syncListBatches(); + } + + public static void syncListBatches() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + ListBatchesRequest request = + ListBatchesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Batch element : batchControllerClient.listBatches(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_listbatches_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesLocationname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesLocationname.java new file mode 100644 index 000000000000..b2824ecd987b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_listbatches_locationname_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListBatchesLocationname { + + public static void main(String[] args) throws Exception { + syncListBatchesLocationname(); + } + + public static void syncListBatchesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Batch element : batchControllerClient.listBatches(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_listbatches_locationname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesString.java new file mode 100644 index 000000000000..c782960840ca --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollerclient/listbatches/SyncListBatchesString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollerclient_listbatches_string_sync] +import com.google.cloud.dataproc.v1.Batch; +import com.google.cloud.dataproc.v1.BatchControllerClient; +import com.google.cloud.dataproc.v1.LocationName; + +public class SyncListBatchesString { + + public static void main(String[] args) throws Exception { + syncListBatchesString(); + } + + public static void syncListBatchesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BatchControllerClient batchControllerClient = BatchControllerClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Batch element : batchControllerClient.listBatches(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_batchcontrollerclient_listbatches_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollersettings/getbatch/SyncGetBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollersettings/getbatch/SyncGetBatch.java new file mode 100644 index 000000000000..8dd2ff327f3a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/batchcontrollersettings/getbatch/SyncGetBatch.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_batchcontrollersettings_getbatch_sync] +import com.google.cloud.dataproc.v1.BatchControllerSettings; +import java.time.Duration; + +public class SyncGetBatch { + + public static void main(String[] args) throws Exception { + syncGetBatch(); + } + + public static void syncGetBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BatchControllerSettings.Builder batchControllerSettingsBuilder = + BatchControllerSettings.newBuilder(); + batchControllerSettingsBuilder + .getBatchSettings() + .setRetrySettings( + batchControllerSettingsBuilder + .getBatchSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BatchControllerSettings batchControllerSettings = batchControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_batchcontrollersettings_getbatch_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..e06714602a82 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterControllerSettings; +import com.google.cloud.dataproc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ClusterControllerSettings clusterControllerSettings = + ClusterControllerSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ClusterControllerClient clusterControllerClient = + ClusterControllerClient.create(clusterControllerSettings); + } +} +// [END dataproc_v1_generated_clustercontrollerclient_create_setcredentialsprovider_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider1.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..5fb0af6ae23a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterControllerSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ClusterControllerSettings clusterControllerSettings = + ClusterControllerSettings.newBuilder() + .setTransportChannelProvider( + ClusterControllerSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + ClusterControllerClient clusterControllerClient = + ClusterControllerClient.create(clusterControllerSettings); + } +} +// [END dataproc_v1_generated_clustercontrollerclient_create_setcredentialsprovider1_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetEndpoint.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..fdf73a948e23 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_create_setendpoint_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterControllerSettings; +import com.google.cloud.dataproc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ClusterControllerSettings clusterControllerSettings = + ClusterControllerSettings.newBuilder().setEndpoint(myEndpoint).build(); + ClusterControllerClient clusterControllerClient = + ClusterControllerClient.create(clusterControllerSettings); + } +} +// [END dataproc_v1_generated_clustercontrollerclient_create_setendpoint_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..03bc07b84321 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateCluster.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_createcluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.CreateClusterRequest; +import com.google.cloud.dataproc.v1.FailureAction; +import com.google.longrunning.Operation; + +public class AsyncCreateCluster { + + public static void main(String[] args) throws Exception { + asyncCreateCluster(); + } + + public static void asyncCreateCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setActionOnFailedPrimaryWorkers(FailureAction.forNumber(0)) + .build(); + ApiFuture future = + clusterControllerClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_createcluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..9d82a33f3981 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_createcluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.CreateClusterRequest; +import com.google.cloud.dataproc.v1.FailureAction; + +public class AsyncCreateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncCreateClusterLRO(); + } + + public static void asyncCreateClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setActionOnFailedPrimaryWorkers(FailureAction.forNumber(0)) + .build(); + OperationFuture future = + clusterControllerClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_createcluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..77d68833e5e0 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateCluster.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_createcluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.CreateClusterRequest; +import com.google.cloud.dataproc.v1.FailureAction; + +public class SyncCreateCluster { + + public static void main(String[] args) throws Exception { + syncCreateCluster(); + } + + public static void syncCreateCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .setActionOnFailedPrimaryWorkers(FailureAction.forNumber(0)) + .build(); + Cluster response = clusterControllerClient.createClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_createcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateClusterStringStringCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateClusterStringStringCluster.java new file mode 100644 index 000000000000..57fc3d084bd9 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/createcluster/SyncCreateClusterStringStringCluster.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_createcluster_stringstringcluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; + +public class SyncCreateClusterStringStringCluster { + + public static void main(String[] args) throws Exception { + syncCreateClusterStringStringCluster(); + } + + public static void syncCreateClusterStringStringCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + Cluster cluster = Cluster.newBuilder().build(); + Cluster response = + clusterControllerClient.createClusterAsync(projectId, region, cluster).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_createcluster_stringstringcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..6711e2356c76 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_deletecluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.DeleteClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteCluster { + + public static void main(String[] args) throws Exception { + asyncDeleteCluster(); + } + + public static void asyncDeleteCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + clusterControllerClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_deletecluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..02704096590d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_deletecluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.DeleteClusterRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteClusterLRO(); + } + + public static void asyncDeleteClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + clusterControllerClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_deletecluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..9df6e95aed12 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_deletecluster_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.DeleteClusterRequest; + +public class SyncDeleteCluster { + + public static void main(String[] args) throws Exception { + syncDeleteCluster(); + } + + public static void syncDeleteCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + clusterControllerClient.deleteClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_deletecluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteClusterStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteClusterStringStringString.java new file mode 100644 index 000000000000..8c2e64776fe7 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/deletecluster/SyncDeleteClusterStringStringString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_deletecluster_stringstringstring_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; + +public class SyncDeleteClusterStringStringString { + + public static void main(String[] args) throws Exception { + syncDeleteClusterStringStringString(); + } + + public static void syncDeleteClusterStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String clusterName = "clusterName-1141738587"; + clusterControllerClient.deleteClusterAsync(projectId, region, clusterName).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_deletecluster_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseCluster.java new file mode 100644 index 000000000000..1da70de62ca0 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseCluster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_diagnosecluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.DiagnoseClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncDiagnoseCluster { + + public static void main(String[] args) throws Exception { + asyncDiagnoseCluster(); + } + + public static void asyncDiagnoseCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DiagnoseClusterRequest request = + DiagnoseClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .build(); + ApiFuture future = + clusterControllerClient.diagnoseClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_diagnosecluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseClusterLRO.java new file mode 100644 index 000000000000..7d636db1588c --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/AsyncDiagnoseClusterLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_diagnosecluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.DiagnoseClusterRequest; +import com.google.cloud.dataproc.v1.DiagnoseClusterResults; + +public class AsyncDiagnoseClusterLRO { + + public static void main(String[] args) throws Exception { + asyncDiagnoseClusterLRO(); + } + + public static void asyncDiagnoseClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DiagnoseClusterRequest request = + DiagnoseClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .build(); + OperationFuture future = + clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request); + // Do something. + DiagnoseClusterResults response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_diagnosecluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseCluster.java new file mode 100644 index 000000000000..20300a903bec --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseCluster.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_diagnosecluster_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.DiagnoseClusterRequest; +import com.google.cloud.dataproc.v1.DiagnoseClusterResults; + +public class SyncDiagnoseCluster { + + public static void main(String[] args) throws Exception { + syncDiagnoseCluster(); + } + + public static void syncDiagnoseCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + DiagnoseClusterRequest request = + DiagnoseClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .build(); + DiagnoseClusterResults response = clusterControllerClient.diagnoseClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_diagnosecluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseClusterStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseClusterStringStringString.java new file mode 100644 index 000000000000..faeb2316cddc --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/diagnosecluster/SyncDiagnoseClusterStringStringString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_diagnosecluster_stringstringstring_sync] +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.DiagnoseClusterResults; + +public class SyncDiagnoseClusterStringStringString { + + public static void main(String[] args) throws Exception { + syncDiagnoseClusterStringStringString(); + } + + public static void syncDiagnoseClusterStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String clusterName = "clusterName-1141738587"; + DiagnoseClusterResults response = + clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_diagnosecluster_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/AsyncGetCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..2d38e4eb5a4f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/AsyncGetCluster.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_getcluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.GetClusterRequest; + +public class AsyncGetCluster { + + public static void main(String[] args) throws Exception { + asyncGetCluster(); + } + + public static void asyncGetCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .build(); + ApiFuture future = clusterControllerClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_getcluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..28a3eafce36f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetCluster.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_getcluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.GetClusterRequest; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .build(); + Cluster response = clusterControllerClient.getCluster(request); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_getcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetClusterStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetClusterStringStringString.java new file mode 100644 index 000000000000..bcc209a9891d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/getcluster/SyncGetClusterStringStringString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_getcluster_stringstringstring_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; + +public class SyncGetClusterStringStringString { + + public static void main(String[] args) throws Exception { + syncGetClusterStringStringString(); + } + + public static void syncGetClusterStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String clusterName = "clusterName-1141738587"; + Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_getcluster_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClusters.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..ea1429e8b6e1 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClusters.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_listclusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ListClustersRequest; + +public class AsyncListClusters { + + public static void main(String[] args) throws Exception { + asyncListClusters(); + } + + public static void asyncListClusters() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + clusterControllerClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_listclusters_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClustersPaged.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..ed2f2ee4df35 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_listclusters_paged_async] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ListClustersRequest; +import com.google.cloud.dataproc.v1.ListClustersResponse; +import com.google.common.base.Strings; + +public class AsyncListClustersPaged { + + public static void main(String[] args) throws Exception { + asyncListClustersPaged(); + } + + public static void asyncListClustersPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListClustersResponse response = + clusterControllerClient.listClustersCallable().call(request); + for (Cluster element : response.getClustersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_listclusters_paged_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClusters.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..169a399792c3 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClusters.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_listclusters_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ListClustersRequest; + +public class SyncListClusters { + + public static void main(String[] args) throws Exception { + syncListClusters(); + } + + public static void syncListClusters() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Cluster element : clusterControllerClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_listclusters_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringString.java new file mode 100644 index 000000000000..0edd1e44fcb0 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_listclusters_stringstring_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; + +public class SyncListClustersStringString { + + public static void main(String[] args) throws Exception { + syncListClustersStringString(); + } + + public static void syncListClustersStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + for (Cluster element : clusterControllerClient.listClusters(projectId, region).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_listclusters_stringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringStringString.java new file mode 100644 index 000000000000..304cf1337985 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/listclusters/SyncListClustersStringStringString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_listclusters_stringstringstring_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; + +public class SyncListClustersStringStringString { + + public static void main(String[] args) throws Exception { + syncListClustersStringStringString(); + } + + public static void syncListClustersStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String filter = "filter-1274492040"; + for (Cluster element : + clusterControllerClient.listClusters(projectId, region, filter).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_listclusters_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartCluster.java new file mode 100644 index 000000000000..1a67986bd22e --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_startcluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.StartClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncStartCluster { + + public static void main(String[] args) throws Exception { + asyncStartCluster(); + } + + public static void asyncStartCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StartClusterRequest request = + StartClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + clusterControllerClient.startClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_startcluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartClusterLRO.java new file mode 100644 index 000000000000..af670b251cf2 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/AsyncStartClusterLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_startcluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.StartClusterRequest; + +public class AsyncStartClusterLRO { + + public static void main(String[] args) throws Exception { + asyncStartClusterLRO(); + } + + public static void asyncStartClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StartClusterRequest request = + StartClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + clusterControllerClient.startClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_startcluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/SyncStartCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/SyncStartCluster.java new file mode 100644 index 000000000000..3d52d1c99632 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/startcluster/SyncStartCluster.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_startcluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.StartClusterRequest; + +public class SyncStartCluster { + + public static void main(String[] args) throws Exception { + syncStartCluster(); + } + + public static void syncStartCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StartClusterRequest request = + StartClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + Cluster response = clusterControllerClient.startClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_startcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopCluster.java new file mode 100644 index 000000000000..126ffe30f3fb --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_stopcluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.StopClusterRequest; +import com.google.longrunning.Operation; + +public class AsyncStopCluster { + + public static void main(String[] args) throws Exception { + asyncStopCluster(); + } + + public static void asyncStopCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StopClusterRequest request = + StopClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + clusterControllerClient.stopClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_stopcluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopClusterLRO.java new file mode 100644 index 000000000000..fdc31376b190 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/AsyncStopClusterLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_stopcluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.StopClusterRequest; + +public class AsyncStopClusterLRO { + + public static void main(String[] args) throws Exception { + asyncStopClusterLRO(); + } + + public static void asyncStopClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StopClusterRequest request = + StopClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + clusterControllerClient.stopClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_stopcluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/SyncStopCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/SyncStopCluster.java new file mode 100644 index 000000000000..108b7265bd4c --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/stopcluster/SyncStopCluster.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_stopcluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.StopClusterRequest; + +public class SyncStopCluster { + + public static void main(String[] args) throws Exception { + syncStopCluster(); + } + + public static void syncStopCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + StopClusterRequest request = + StopClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setClusterUuid("clusterUuid-1141510955") + .setRequestId("requestId693933066") + .build(); + Cluster response = clusterControllerClient.stopClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_stopcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..ed57bc594151 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_updatecluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCluster { + + public static void main(String[] args) throws Exception { + asyncUpdateCluster(); + } + + public static void asyncUpdateCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setCluster(Cluster.newBuilder().build()) + .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + clusterControllerClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_updatecluster_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateClusterLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..dca39c3f547a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_updatecluster_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.ClusterOperationMetadata; +import com.google.cloud.dataproc.v1.UpdateClusterRequest; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateClusterLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateClusterLRO(); + } + + public static void asyncUpdateClusterLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setCluster(Cluster.newBuilder().build()) + .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + clusterControllerClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_updatecluster_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..3fa4c0644663 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollerclient_updatecluster_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.cloud.dataproc.v1.UpdateClusterRequest; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCluster { + + public static void main(String[] args) throws Exception { + syncUpdateCluster(); + } + + public static void syncUpdateCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setClusterName("clusterName-1141738587") + .setCluster(Cluster.newBuilder().build()) + .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Cluster response = clusterControllerClient.updateClusterAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_clustercontrollerclient_updatecluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateClusterStringStringStringClusterFieldmask.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateClusterStringStringStringClusterFieldmask.java new file mode 100644 index 000000000000..9a8c039adef4 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollerclient/updatecluster/SyncUpdateClusterStringStringStringClusterFieldmask.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_clustercontrollerclient_updatecluster_stringstringstringclusterfieldmask_sync] +import com.google.cloud.dataproc.v1.Cluster; +import com.google.cloud.dataproc.v1.ClusterControllerClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateClusterStringStringStringClusterFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateClusterStringStringStringClusterFieldmask(); + } + + public static void syncUpdateClusterStringStringStringClusterFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String clusterName = "clusterName-1141738587"; + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = + clusterControllerClient + .updateClusterAsync(projectId, region, clusterName, cluster, updateMask) + .get(); + } + } +} +// [END +// dataproc_v1_generated_clustercontrollerclient_updatecluster_stringstringstringclusterfieldmask_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollersettings/getcluster/SyncGetCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollersettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..796b86ee1955 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/clustercontrollersettings/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_clustercontrollersettings_getcluster_sync] +import com.google.cloud.dataproc.v1.ClusterControllerSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ClusterControllerSettings.Builder clusterControllerSettingsBuilder = + ClusterControllerSettings.newBuilder(); + clusterControllerSettingsBuilder + .getClusterSettings() + .setRetrySettings( + clusterControllerSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ClusterControllerSettings clusterControllerSettings = clusterControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_clustercontrollersettings_getcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/AsyncCancelJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/AsyncCancelJob.java new file mode 100644 index 000000000000..e63d9946e28c --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/AsyncCancelJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_canceljob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.CancelJobRequest; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class AsyncCancelJob { + + public static void main(String[] args) throws Exception { + asyncCancelJob(); + } + + public static void asyncCancelJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + CancelJobRequest request = + CancelJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + ApiFuture future = jobControllerClient.cancelJobCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_canceljob_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJob.java new file mode 100644 index 000000000000..325abde7a160 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJob.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_canceljob_sync] +import com.google.cloud.dataproc.v1.CancelJobRequest; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncCancelJob { + + public static void main(String[] args) throws Exception { + syncCancelJob(); + } + + public static void syncCancelJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + CancelJobRequest request = + CancelJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + Job response = jobControllerClient.cancelJob(request); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_canceljob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJobStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJobStringStringString.java new file mode 100644 index 000000000000..25db1d5b179e --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/canceljob/SyncCancelJobStringStringString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_canceljob_stringstringstring_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncCancelJobStringStringString { + + public static void main(String[] args) throws Exception { + syncCancelJobStringStringString(); + } + + public static void syncCancelJobStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String jobId = "jobId101296568"; + Job response = jobControllerClient.cancelJob(projectId, region, jobId); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_canceljob_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..76b8afcc8755 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.JobControllerSettings; +import com.google.cloud.dataproc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + JobControllerSettings jobControllerSettings = + JobControllerSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings); + } +} +// [END dataproc_v1_generated_jobcontrollerclient_create_setcredentialsprovider_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider1.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..25e3519aab30 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.JobControllerSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + JobControllerSettings jobControllerSettings = + JobControllerSettings.newBuilder() + .setTransportChannelProvider( + JobControllerSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings); + } +} +// [END dataproc_v1_generated_jobcontrollerclient_create_setcredentialsprovider1_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetEndpoint.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e1592969cca5 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_create_setendpoint_sync] +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.JobControllerSettings; +import com.google.cloud.dataproc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + JobControllerSettings jobControllerSettings = + JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build(); + JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings); + } +} +// [END dataproc_v1_generated_jobcontrollerclient_create_setendpoint_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/AsyncDeleteJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/AsyncDeleteJob.java new file mode 100644 index 000000000000..5daa0298b5b4 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/AsyncDeleteJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_deletejob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.DeleteJobRequest; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteJob { + + public static void main(String[] args) throws Exception { + asyncDeleteJob(); + } + + public static void asyncDeleteJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + DeleteJobRequest request = + DeleteJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + ApiFuture future = jobControllerClient.deleteJobCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_deletejob_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJob.java new file mode 100644 index 000000000000..10c0037488b4 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJob.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_deletejob_sync] +import com.google.cloud.dataproc.v1.DeleteJobRequest; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncDeleteJob { + + public static void main(String[] args) throws Exception { + syncDeleteJob(); + } + + public static void syncDeleteJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + DeleteJobRequest request = + DeleteJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + jobControllerClient.deleteJob(request); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_deletejob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJobStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJobStringStringString.java new file mode 100644 index 000000000000..f90172178d30 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/deletejob/SyncDeleteJobStringStringString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_deletejob_stringstringstring_sync] +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncDeleteJobStringStringString { + + public static void main(String[] args) throws Exception { + syncDeleteJobStringStringString(); + } + + public static void syncDeleteJobStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String jobId = "jobId101296568"; + jobControllerClient.deleteJob(projectId, region, jobId); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_deletejob_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/AsyncGetJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/AsyncGetJob.java new file mode 100644 index 000000000000..46c3dfb79f95 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/AsyncGetJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_getjob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.GetJobRequest; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class AsyncGetJob { + + public static void main(String[] args) throws Exception { + asyncGetJob(); + } + + public static void asyncGetJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + GetJobRequest request = + GetJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + ApiFuture future = jobControllerClient.getJobCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_getjob_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJob.java new file mode 100644 index 000000000000..9da587f6d07d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJob.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_getjob_sync] +import com.google.cloud.dataproc.v1.GetJobRequest; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncGetJob { + + public static void main(String[] args) throws Exception { + syncGetJob(); + } + + public static void syncGetJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + GetJobRequest request = + GetJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .build(); + Job response = jobControllerClient.getJob(request); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_getjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJobStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJobStringStringString.java new file mode 100644 index 000000000000..d7b2d64feb8b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/getjob/SyncGetJobStringStringString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_getjob_stringstringstring_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncGetJobStringStringString { + + public static void main(String[] args) throws Exception { + syncGetJobStringStringString(); + } + + public static void syncGetJobStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String jobId = "jobId101296568"; + Job response = jobControllerClient.getJob(projectId, region, jobId); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_getjob_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobs.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobs.java new file mode 100644 index 000000000000..54911a3e0d34 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobs.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_listjobs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.ListJobsRequest; + +public class AsyncListJobs { + + public static void main(String[] args) throws Exception { + asyncListJobs(); + } + + public static void asyncListJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setClusterName("clusterName-1141738587") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = jobControllerClient.listJobsPagedCallable().futureCall(request); + // Do something. + for (Job element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_listjobs_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobsPaged.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobsPaged.java new file mode 100644 index 000000000000..30faa05353de --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/AsyncListJobsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_listjobs_paged_async] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.ListJobsRequest; +import com.google.cloud.dataproc.v1.ListJobsResponse; +import com.google.common.base.Strings; + +public class AsyncListJobsPaged { + + public static void main(String[] args) throws Exception { + asyncListJobsPaged(); + } + + public static void asyncListJobsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setClusterName("clusterName-1141738587") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListJobsResponse response = jobControllerClient.listJobsCallable().call(request); + for (Job element : response.getJobsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_listjobs_paged_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobs.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobs.java new file mode 100644 index 000000000000..91d707ceb435 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobs.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_listjobs_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.ListJobsRequest; + +public class SyncListJobs { + + public static void main(String[] args) throws Exception { + syncListJobs(); + } + + public static void syncListJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + ListJobsRequest request = + ListJobsRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setClusterName("clusterName-1141738587") + .setFilter("filter-1274492040") + .build(); + for (Job element : jobControllerClient.listJobs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_listjobs_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringString.java new file mode 100644 index 000000000000..f0ecd6c2dff5 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_listjobs_stringstring_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncListJobsStringString { + + public static void main(String[] args) throws Exception { + syncListJobsStringString(); + } + + public static void syncListJobsStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + for (Job element : jobControllerClient.listJobs(projectId, region).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_listjobs_stringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringStringString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringStringString.java new file mode 100644 index 000000000000..a597c7afc93c --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/listjobs/SyncListJobsStringStringString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_listjobs_stringstringstring_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncListJobsStringStringString { + + public static void main(String[] args) throws Exception { + syncListJobsStringStringString(); + } + + public static void syncListJobsStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + String filter = "filter-1274492040"; + for (Job element : jobControllerClient.listJobs(projectId, region, filter).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_listjobs_stringstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/AsyncSubmitJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/AsyncSubmitJob.java new file mode 100644 index 000000000000..43d0c9f67f37 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/AsyncSubmitJob.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.SubmitJobRequest; + +public class AsyncSubmitJob { + + public static void main(String[] args) throws Exception { + asyncSubmitJob(); + } + + public static void asyncSubmitJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJob(Job.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = jobControllerClient.submitJobCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjob_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJob.java new file mode 100644 index 000000000000..4af2efbe769d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJob.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjob_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.SubmitJobRequest; + +public class SyncSubmitJob { + + public static void main(String[] args) throws Exception { + syncSubmitJob(); + } + + public static void syncSubmitJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJob(Job.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Job response = jobControllerClient.submitJob(request); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJobStringStringJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJobStringStringJob.java new file mode 100644 index 000000000000..c64a0f4232f6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjob/SyncSubmitJobStringStringJob.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjob_stringstringjob_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncSubmitJobStringStringJob { + + public static void main(String[] args) throws Exception { + syncSubmitJobStringStringJob(); + } + + public static void syncSubmitJobStringStringJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + Job response = jobControllerClient.submitJob(projectId, region, job); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjob_stringstringjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperation.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperation.java new file mode 100644 index 000000000000..a00a67e42656 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperation.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.SubmitJobRequest; +import com.google.longrunning.Operation; + +public class AsyncSubmitJobAsOperation { + + public static void main(String[] args) throws Exception { + asyncSubmitJobAsOperation(); + } + + public static void asyncSubmitJobAsOperation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJob(Job.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + jobControllerClient.submitJobAsOperationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperationLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperationLRO.java new file mode 100644 index 000000000000..18f8f52f75f6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/AsyncSubmitJobAsOperationLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.JobMetadata; +import com.google.cloud.dataproc.v1.SubmitJobRequest; + +public class AsyncSubmitJobAsOperationLRO { + + public static void main(String[] args) throws Exception { + asyncSubmitJobAsOperationLRO(); + } + + public static void asyncSubmitJobAsOperationLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJob(Job.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperation.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperation.java new file mode 100644 index 000000000000..8b7bd1a4c451 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.SubmitJobRequest; + +public class SyncSubmitJobAsOperation { + + public static void main(String[] args) throws Exception { + syncSubmitJobAsOperation(); + } + + public static void syncSubmitJobAsOperation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + SubmitJobRequest request = + SubmitJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJob(Job.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Job response = jobControllerClient.submitJobAsOperationAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperationStringStringJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperationStringStringJob.java new file mode 100644 index 000000000000..8a9a022d08d8 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/submitjobasoperation/SyncSubmitJobAsOperationStringStringJob.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_stringstringjob_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; + +public class SyncSubmitJobAsOperationStringStringJob { + + public static void main(String[] args) throws Exception { + syncSubmitJobAsOperationStringStringJob(); + } + + public static void syncSubmitJobAsOperationStringStringJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + String projectId = "projectId-894832108"; + String region = "region-934795532"; + Job job = Job.newBuilder().build(); + Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_submitjobasoperation_stringstringjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/AsyncUpdateJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/AsyncUpdateJob.java new file mode 100644 index 000000000000..c19716b008cd --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/AsyncUpdateJob.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_updatejob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.UpdateJobRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateJob { + + public static void main(String[] args) throws Exception { + asyncUpdateJob(); + } + + public static void asyncUpdateJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + UpdateJobRequest request = + UpdateJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .setJob(Job.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = jobControllerClient.updateJobCallable().futureCall(request); + // Do something. + Job response = future.get(); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_updatejob_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/SyncUpdateJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/SyncUpdateJob.java new file mode 100644 index 000000000000..9822c85ede31 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollerclient/updatejob/SyncUpdateJob.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollerclient_updatejob_sync] +import com.google.cloud.dataproc.v1.Job; +import com.google.cloud.dataproc.v1.JobControllerClient; +import com.google.cloud.dataproc.v1.UpdateJobRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateJob { + + public static void main(String[] args) throws Exception { + syncUpdateJob(); + } + + public static void syncUpdateJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + UpdateJobRequest request = + UpdateJobRequest.newBuilder() + .setProjectId("projectId-894832108") + .setRegion("region-934795532") + .setJobId("jobId101296568") + .setJob(Job.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Job response = jobControllerClient.updateJob(request); + } + } +} +// [END dataproc_v1_generated_jobcontrollerclient_updatejob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollersettings/submitjob/SyncSubmitJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollersettings/submitjob/SyncSubmitJob.java new file mode 100644 index 000000000000..ddeebe212fd3 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/jobcontrollersettings/submitjob/SyncSubmitJob.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_jobcontrollersettings_submitjob_sync] +import com.google.cloud.dataproc.v1.JobControllerSettings; +import java.time.Duration; + +public class SyncSubmitJob { + + public static void main(String[] args) throws Exception { + syncSubmitJob(); + } + + public static void syncSubmitJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + JobControllerSettings.Builder jobControllerSettingsBuilder = JobControllerSettings.newBuilder(); + jobControllerSettingsBuilder + .submitJobSettings() + .setRetrySettings( + jobControllerSettingsBuilder + .submitJobSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + JobControllerSettings jobControllerSettings = jobControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_jobcontrollersettings_submitjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/autoscalingpolicyservicestubsettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/autoscalingpolicyservicestubsettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java new file mode 100644 index 000000000000..84d382588f20 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/autoscalingpolicyservicestubsettings/createautoscalingpolicy/SyncCreateAutoscalingPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub.samples; + +// [START dataproc_v1_generated_autoscalingpolicyservicestubsettings_createautoscalingpolicy_sync] +import com.google.cloud.dataproc.v1.stub.AutoscalingPolicyServiceStubSettings; +import java.time.Duration; + +public class SyncCreateAutoscalingPolicy { + + public static void main(String[] args) throws Exception { + syncCreateAutoscalingPolicy(); + } + + public static void syncCreateAutoscalingPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder = + AutoscalingPolicyServiceStubSettings.newBuilder(); + autoscalingPolicyServiceSettingsBuilder + .createAutoscalingPolicySettings() + .setRetrySettings( + autoscalingPolicyServiceSettingsBuilder + .createAutoscalingPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AutoscalingPolicyServiceStubSettings autoscalingPolicyServiceSettings = + autoscalingPolicyServiceSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_autoscalingpolicyservicestubsettings_createautoscalingpolicy_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/batchcontrollerstubsettings/getbatch/SyncGetBatch.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/batchcontrollerstubsettings/getbatch/SyncGetBatch.java new file mode 100644 index 000000000000..1871ca997b35 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/batchcontrollerstubsettings/getbatch/SyncGetBatch.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub.samples; + +// [START dataproc_v1_generated_batchcontrollerstubsettings_getbatch_sync] +import com.google.cloud.dataproc.v1.stub.BatchControllerStubSettings; +import java.time.Duration; + +public class SyncGetBatch { + + public static void main(String[] args) throws Exception { + syncGetBatch(); + } + + public static void syncGetBatch() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BatchControllerStubSettings.Builder batchControllerSettingsBuilder = + BatchControllerStubSettings.newBuilder(); + batchControllerSettingsBuilder + .getBatchSettings() + .setRetrySettings( + batchControllerSettingsBuilder + .getBatchSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BatchControllerStubSettings batchControllerSettings = batchControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_batchcontrollerstubsettings_getbatch_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/clustercontrollerstubsettings/getcluster/SyncGetCluster.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/clustercontrollerstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..62e2cd8eb133 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/clustercontrollerstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub.samples; + +// [START dataproc_v1_generated_clustercontrollerstubsettings_getcluster_sync] +import com.google.cloud.dataproc.v1.stub.ClusterControllerStubSettings; +import java.time.Duration; + +public class SyncGetCluster { + + public static void main(String[] args) throws Exception { + syncGetCluster(); + } + + public static void syncGetCluster() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ClusterControllerStubSettings.Builder clusterControllerSettingsBuilder = + ClusterControllerStubSettings.newBuilder(); + clusterControllerSettingsBuilder + .getClusterSettings() + .setRetrySettings( + clusterControllerSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ClusterControllerStubSettings clusterControllerSettings = + clusterControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_clustercontrollerstubsettings_getcluster_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/jobcontrollerstubsettings/submitjob/SyncSubmitJob.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/jobcontrollerstubsettings/submitjob/SyncSubmitJob.java new file mode 100644 index 000000000000..72479b320907 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/jobcontrollerstubsettings/submitjob/SyncSubmitJob.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub.samples; + +// [START dataproc_v1_generated_jobcontrollerstubsettings_submitjob_sync] +import com.google.cloud.dataproc.v1.stub.JobControllerStubSettings; +import java.time.Duration; + +public class SyncSubmitJob { + + public static void main(String[] args) throws Exception { + syncSubmitJob(); + } + + public static void syncSubmitJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + JobControllerStubSettings.Builder jobControllerSettingsBuilder = + JobControllerStubSettings.newBuilder(); + jobControllerSettingsBuilder + .submitJobSettings() + .setRetrySettings( + jobControllerSettingsBuilder + .submitJobSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + JobControllerStubSettings jobControllerSettings = jobControllerSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_jobcontrollerstubsettings_submitjob_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/workflowtemplateservicestubsettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/workflowtemplateservicestubsettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java new file mode 100644 index 000000000000..ad713e860290 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/stub/workflowtemplateservicestubsettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.stub.samples; + +// [START dataproc_v1_generated_workflowtemplateservicestubsettings_createworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.stub.WorkflowTemplateServiceStubSettings; +import java.time.Duration; + +public class SyncCreateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplate(); + } + + public static void syncCreateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + WorkflowTemplateServiceStubSettings.Builder workflowTemplateServiceSettingsBuilder = + WorkflowTemplateServiceStubSettings.newBuilder(); + workflowTemplateServiceSettingsBuilder + .createWorkflowTemplateSettings() + .setRetrySettings( + workflowTemplateServiceSettingsBuilder + .createWorkflowTemplateSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + WorkflowTemplateServiceStubSettings workflowTemplateServiceSettings = + workflowTemplateServiceSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_workflowtemplateservicestubsettings_createworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..55958c39c593 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceSettings; +import com.google.cloud.dataproc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + WorkflowTemplateServiceSettings workflowTemplateServiceSettings = + WorkflowTemplateServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings); + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_create_setcredentialsprovider_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider1.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..e0bbbaf0f49d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + WorkflowTemplateServiceSettings workflowTemplateServiceSettings = + WorkflowTemplateServiceSettings.newBuilder() + .setTransportChannelProvider( + WorkflowTemplateServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings); + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_create_setcredentialsprovider1_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetEndpoint.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..4367186b904b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_create_setendpoint_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceSettings; +import com.google.cloud.dataproc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + WorkflowTemplateServiceSettings workflowTemplateServiceSettings = + WorkflowTemplateServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings); + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_create_setendpoint_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/AsyncCreateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/AsyncCreateWorkflowTemplate.java new file mode 100644 index 000000000000..645e77411b86 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/AsyncCreateWorkflowTemplate.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class AsyncCreateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncCreateWorkflowTemplate(); + } + + public static void asyncCreateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setTemplate(WorkflowTemplate.newBuilder().build()) + .build(); + ApiFuture future = + workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request); + // Do something. + WorkflowTemplate response = future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplate.java new file mode 100644 index 000000000000..6b26666366ac --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplate.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncCreateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplate(); + } + + public static void syncCreateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + CreateWorkflowTemplateRequest request = + CreateWorkflowTemplateRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setTemplate(WorkflowTemplate.newBuilder().build()) + .build(); + WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateLocationnameWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateLocationnameWorkflowtemplate.java new file mode 100644 index 000000000000..33e5470a9c46 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateLocationnameWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_locationnameworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.LocationName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncCreateWorkflowTemplateLocationnameWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplateLocationnameWorkflowtemplate(); + } + + public static void syncCreateWorkflowTemplateLocationnameWorkflowtemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + WorkflowTemplate response = + workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_locationnameworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateRegionnameWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateRegionnameWorkflowtemplate.java new file mode 100644 index 000000000000..cf35bb05978a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateRegionnameWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_regionnameworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncCreateWorkflowTemplateRegionnameWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplateRegionnameWorkflowtemplate(); + } + + public static void syncCreateWorkflowTemplateRegionnameWorkflowtemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + WorkflowTemplate response = + workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_regionnameworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateStringWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateStringWorkflowtemplate.java new file mode 100644 index 000000000000..2f4f08a4d07b --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/createworkflowtemplate/SyncCreateWorkflowTemplateStringWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_stringworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncCreateWorkflowTemplateStringWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplateStringWorkflowtemplate(); + } + + public static void syncCreateWorkflowTemplateStringWorkflowtemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String parent = RegionName.of("[PROJECT]", "[REGION]").toString(); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + WorkflowTemplate response = + workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_createworkflowtemplate_stringworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/AsyncDeleteWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/AsyncDeleteWorkflowTemplate.java new file mode 100644 index 000000000000..9df64c995f40 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/AsyncDeleteWorkflowTemplate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncDeleteWorkflowTemplate(); + } + + public static void asyncDeleteWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + DeleteWorkflowTemplateRequest request = + DeleteWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .build(); + ApiFuture future = + workflowTemplateServiceClient.deleteWorkflowTemplateCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplate.java new file mode 100644 index 000000000000..1a507e1e5f2a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplate.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncDeleteWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncDeleteWorkflowTemplate(); + } + + public static void syncDeleteWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + DeleteWorkflowTemplateRequest request = + DeleteWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .build(); + workflowTemplateServiceClient.deleteWorkflowTemplate(request); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateString.java new file mode 100644 index 000000000000..42458d482e21 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_string_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncDeleteWorkflowTemplateString { + + public static void main(String[] args) throws Exception { + syncDeleteWorkflowTemplateString(); + } + + public static void syncDeleteWorkflowTemplateString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + .toString(); + workflowTemplateServiceClient.deleteWorkflowTemplate(name); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateWorkflowtemplatename.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateWorkflowtemplatename.java new file mode 100644 index 000000000000..11b4a2ca7c5d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/deleteworkflowtemplate/SyncDeleteWorkflowTemplateWorkflowtemplatename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_workflowtemplatename_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncDeleteWorkflowTemplateWorkflowtemplatename { + + public static void main(String[] args) throws Exception { + syncDeleteWorkflowTemplateWorkflowtemplatename(); + } + + public static void syncDeleteWorkflowTemplateWorkflowtemplatename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]"); + workflowTemplateServiceClient.deleteWorkflowTemplate(name); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_deleteworkflowtemplate_workflowtemplatename_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/AsyncGetWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/AsyncGetWorkflowTemplate.java new file mode 100644 index 000000000000..1f447d47c487 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/AsyncGetWorkflowTemplate.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.GetWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class AsyncGetWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncGetWorkflowTemplate(); + } + + public static void asyncGetWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .build(); + ApiFuture future = + workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request); + // Do something. + WorkflowTemplate response = future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplate.java new file mode 100644 index 000000000000..b71d233a7d96 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplate.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.GetWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncGetWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncGetWorkflowTemplate(); + } + + public static void syncGetWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + GetWorkflowTemplateRequest request = + GetWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .build(); + WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateString.java new file mode 100644 index 000000000000..ef6e3294ec95 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_string_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncGetWorkflowTemplateString { + + public static void main(String[] args) throws Exception { + syncGetWorkflowTemplateString(); + } + + public static void syncGetWorkflowTemplateString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + .toString(); + WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateWorkflowtemplatename.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateWorkflowtemplatename.java new file mode 100644 index 000000000000..0a298e880a8f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/getworkflowtemplate/SyncGetWorkflowTemplateWorkflowtemplatename.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_workflowtemplatename_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncGetWorkflowTemplateWorkflowtemplatename { + + public static void main(String[] args) throws Exception { + syncGetWorkflowTemplateWorkflowtemplatename(); + } + + public static void syncGetWorkflowTemplateWorkflowtemplatename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]"); + WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_getworkflowtemplate_workflowtemplatename_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplate.java new file mode 100644 index 000000000000..fdf5cc103be2 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplate.java @@ -0,0 +1,54 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.longrunning.Operation; + +public class AsyncInstantiateInlineWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncInstantiateInlineWorkflowTemplate(); + } + + public static void asyncInstantiateInlineWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setTemplate(WorkflowTemplate.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + workflowTemplateServiceClient + .instantiateInlineWorkflowTemplateCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplateLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplateLRO.java new file mode 100644 index 000000000000..d80de992b0c6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/AsyncInstantiateInlineWorkflowTemplateLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowMetadata; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.protobuf.Empty; + +public class AsyncInstantiateInlineWorkflowTemplateLRO { + + public static void main(String[] args) throws Exception { + asyncInstantiateInlineWorkflowTemplateLRO(); + } + + public static void asyncInstantiateInlineWorkflowTemplateLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setTemplate(WorkflowTemplate.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + workflowTemplateServiceClient + .instantiateInlineWorkflowTemplateOperationCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplate.java new file mode 100644 index 000000000000..c23cf5e761f0 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplate.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateInlineWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncInstantiateInlineWorkflowTemplate(); + } + + public static void syncInstantiateInlineWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateInlineWorkflowTemplateRequest request = + InstantiateInlineWorkflowTemplateRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setTemplate(WorkflowTemplate.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate.java new file mode 100644 index 000000000000..0c5710ec686f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_locationnameworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.LocationName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate(); + } + + public static void syncInstantiateInlineWorkflowTemplateLocationnameWorkflowtemplate() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_locationnameworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate.java new file mode 100644 index 000000000000..ab06515a9e9d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_regionnameworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate(); + } + + public static void syncInstantiateInlineWorkflowTemplateRegionnameWorkflowtemplate() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_regionnameworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateStringWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateStringWorkflowtemplate.java new file mode 100644 index 000000000000..d9a3dace8510 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateinlineworkflowtemplate/SyncInstantiateInlineWorkflowTemplateStringWorkflowtemplate.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_stringworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateInlineWorkflowTemplateStringWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncInstantiateInlineWorkflowTemplateStringWorkflowtemplate(); + } + + public static void syncInstantiateInlineWorkflowTemplateStringWorkflowtemplate() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String parent = RegionName.of("[PROJECT]", "[REGION]").toString(); + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateinlineworkflowtemplate_stringworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplate.java new file mode 100644 index 000000000000..2a5f4ed15981 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplate.java @@ -0,0 +1,55 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.longrunning.Operation; +import java.util.HashMap; + +public class AsyncInstantiateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncInstantiateWorkflowTemplate(); + } + + public static void asyncInstantiateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .setRequestId("requestId693933066") + .putAllParameters(new HashMap()) + .build(); + ApiFuture future = + workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplateLRO.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplateLRO.java new file mode 100644 index 000000000000..a5fd09a5d8ea --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/AsyncInstantiateWorkflowTemplateLRO.java @@ -0,0 +1,58 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowMetadata; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.protobuf.Empty; +import java.util.HashMap; + +public class AsyncInstantiateWorkflowTemplateLRO { + + public static void main(String[] args) throws Exception { + asyncInstantiateWorkflowTemplateLRO(); + } + + public static void asyncInstantiateWorkflowTemplateLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .setRequestId("requestId693933066") + .putAllParameters(new HashMap()) + .build(); + OperationFuture future = + workflowTemplateServiceClient + .instantiateWorkflowTemplateOperationCallable() + .futureCall(request); + // Do something. + future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_lro_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplate.java new file mode 100644 index 000000000000..239177dd385a --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplate.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import java.util.HashMap; + +public class SyncInstantiateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncInstantiateWorkflowTemplate(); + } + + public static void syncInstantiateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + InstantiateWorkflowTemplateRequest request = + InstantiateWorkflowTemplateRequest.newBuilder() + .setName( + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]") + .toString()) + .setVersion(351608024) + .setRequestId("requestId693933066") + .putAllParameters(new HashMap()) + .build(); + workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateString.java new file mode 100644 index 000000000000..be5ea360cfec --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_string_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateWorkflowTemplateString { + + public static void main(String[] args) throws Exception { + syncInstantiateWorkflowTemplateString(); + } + + public static void syncInstantiateWorkflowTemplateString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + .toString(); + workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateStringMapstringstring.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateStringMapstringstring.java new file mode 100644 index 000000000000..584154425081 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateStringMapstringstring.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_stringmapstringstring_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncInstantiateWorkflowTemplateStringMapstringstring { + + public static void main(String[] args) throws Exception { + syncInstantiateWorkflowTemplateStringMapstringstring(); + } + + public static void syncInstantiateWorkflowTemplateStringMapstringstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String name = + WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + .toString(); + Map parameters = new HashMap<>(); + workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_stringmapstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatename.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatename.java new file mode 100644 index 000000000000..816521f3661d --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatename.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_workflowtemplatename_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncInstantiateWorkflowTemplateWorkflowtemplatename { + + public static void main(String[] args) throws Exception { + syncInstantiateWorkflowTemplateWorkflowtemplatename(); + } + + public static void syncInstantiateWorkflowTemplateWorkflowtemplatename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]"); + workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_workflowtemplatename_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring.java new file mode 100644 index 000000000000..56ebcc7a21f6 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/instantiateworkflowtemplate/SyncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_workflowtemplatenamemapstringstring_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateName; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import java.util.HashMap; +import java.util.Map; + +public class SyncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring { + + public static void main(String[] args) throws Exception { + syncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring(); + } + + public static void syncInstantiateWorkflowTemplateWorkflowtemplatenameMapstringstring() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + WorkflowTemplateName name = + WorkflowTemplateName.ofProjectLocationWorkflowTemplateName( + "[PROJECT]", "[LOCATION]", "[WORKFLOW_TEMPLATE]"); + Map parameters = new HashMap<>(); + workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_instantiateworkflowtemplate_workflowtemplatenamemapstringstring_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplates.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplates.java new file mode 100644 index 000000000000..9cbc33d37bc5 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplates.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class AsyncListWorkflowTemplates { + + public static void main(String[] args) throws Exception { + asyncListWorkflowTemplates(); + } + + public static void asyncListWorkflowTemplates() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + ListWorkflowTemplatesRequest request = + ListWorkflowTemplatesRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request); + // Do something. + for (WorkflowTemplate element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplatesPaged.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplatesPaged.java new file mode 100644 index 000000000000..601674e8f653 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/AsyncListWorkflowTemplatesPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_paged_async] +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; +import com.google.common.base.Strings; + +public class AsyncListWorkflowTemplatesPaged { + + public static void main(String[] args) throws Exception { + asyncListWorkflowTemplatesPaged(); + } + + public static void asyncListWorkflowTemplatesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + ListWorkflowTemplatesRequest request = + ListWorkflowTemplatesRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListWorkflowTemplatesResponse response = + workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request); + for (WorkflowTemplate element : response.getTemplatesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_paged_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplates.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplates.java new file mode 100644 index 000000000000..870132454d4f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplates.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_sync] +import com.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncListWorkflowTemplates { + + public static void main(String[] args) throws Exception { + syncListWorkflowTemplates(); + } + + public static void syncListWorkflowTemplates() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + ListWorkflowTemplatesRequest request = + ListWorkflowTemplatesRequest.newBuilder() + .setParent(RegionName.of("[PROJECT]", "[REGION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (WorkflowTemplate element : + workflowTemplateServiceClient.listWorkflowTemplates(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesLocationname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesLocationname.java new file mode 100644 index 000000000000..986db7eee662 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_locationname_sync] +import com.google.cloud.dataproc.v1.LocationName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncListWorkflowTemplatesLocationname { + + public static void main(String[] args) throws Exception { + syncListWorkflowTemplatesLocationname(); + } + + public static void syncListWorkflowTemplatesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (WorkflowTemplate element : + workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_locationname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesRegionname.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesRegionname.java new file mode 100644 index 000000000000..1a22892b4d66 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesRegionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_regionname_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncListWorkflowTemplatesRegionname { + + public static void main(String[] args) throws Exception { + syncListWorkflowTemplatesRegionname(); + } + + public static void syncListWorkflowTemplatesRegionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + for (WorkflowTemplate element : + workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_regionname_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesString.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesString.java new file mode 100644 index 000000000000..5104956a51bb --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/listworkflowtemplates/SyncListWorkflowTemplatesString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_string_sync] +import com.google.cloud.dataproc.v1.RegionName; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncListWorkflowTemplatesString { + + public static void main(String[] args) throws Exception { + syncListWorkflowTemplatesString(); + } + + public static void syncListWorkflowTemplatesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + String parent = RegionName.of("[PROJECT]", "[REGION]").toString(); + for (WorkflowTemplate element : + workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_listworkflowtemplates_string_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/AsyncUpdateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/AsyncUpdateWorkflowTemplate.java new file mode 100644 index 000000000000..519415e64418 --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/AsyncUpdateWorkflowTemplate.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class AsyncUpdateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + asyncUpdateWorkflowTemplate(); + } + + public static void asyncUpdateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + UpdateWorkflowTemplateRequest request = + UpdateWorkflowTemplateRequest.newBuilder() + .setTemplate(WorkflowTemplate.newBuilder().build()) + .build(); + ApiFuture future = + workflowTemplateServiceClient.updateWorkflowTemplateCallable().futureCall(request); + // Do something. + WorkflowTemplate response = future.get(); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_async] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplate.java new file mode 100644 index 000000000000..fbea63d2e3fd --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplate.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncUpdateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncUpdateWorkflowTemplate(); + } + + public static void syncUpdateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + UpdateWorkflowTemplateRequest request = + UpdateWorkflowTemplateRequest.newBuilder() + .setTemplate(WorkflowTemplate.newBuilder().build()) + .build(); + WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(request); + } + } +} +// [END dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplateWorkflowtemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplateWorkflowtemplate.java new file mode 100644 index 000000000000..54295b8bff6e --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateserviceclient/updateworkflowtemplate/SyncUpdateWorkflowTemplateWorkflowtemplate.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START +// dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_workflowtemplate_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplate; +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceClient; + +public class SyncUpdateWorkflowTemplateWorkflowtemplate { + + public static void main(String[] args) throws Exception { + syncUpdateWorkflowTemplateWorkflowtemplate(); + } + + public static void syncUpdateWorkflowTemplateWorkflowtemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + WorkflowTemplateServiceClient.create()) { + WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(template); + } + } +} +// [END +// dataproc_v1_generated_workflowtemplateserviceclient_updateworkflowtemplate_workflowtemplate_sync] diff --git a/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateservicesettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateservicesettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java new file mode 100644 index 000000000000..cf63ba119b9f --- /dev/null +++ b/java-dataproc/samples/snippets/generated/com/google/cloud/dataproc/v1/workflowtemplateservicesettings/createworkflowtemplate/SyncCreateWorkflowTemplate.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dataproc.v1.samples; + +// [START dataproc_v1_generated_workflowtemplateservicesettings_createworkflowtemplate_sync] +import com.google.cloud.dataproc.v1.WorkflowTemplateServiceSettings; +import java.time.Duration; + +public class SyncCreateWorkflowTemplate { + + public static void main(String[] args) throws Exception { + syncCreateWorkflowTemplate(); + } + + public static void syncCreateWorkflowTemplate() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + WorkflowTemplateServiceSettings.Builder workflowTemplateServiceSettingsBuilder = + WorkflowTemplateServiceSettings.newBuilder(); + workflowTemplateServiceSettingsBuilder + .createWorkflowTemplateSettings() + .setRetrySettings( + workflowTemplateServiceSettingsBuilder + .createWorkflowTemplateSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + WorkflowTemplateServiceSettings workflowTemplateServiceSettings = + workflowTemplateServiceSettingsBuilder.build(); + } +} +// [END dataproc_v1_generated_workflowtemplateservicesettings_createworkflowtemplate_sync]