From 240280647b544dfe29b0664f87d62c74e9b281f4 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 31 Aug 2024 00:04:28 +0000 Subject: [PATCH 1/2] feat:add optional parameters (tarball-access) in DiagnoseClusterRequest PiperOrigin-RevId: 669375999 Source-Link: https://github.com/googleapis/googleapis/commit/6a474b31c53cc1797710206824a17b364a835d2d Source-Link: https://github.com/googleapis/googleapis-gen/commit/3e834b4e0df6957c72524c7b63d41c3068ebccb4 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLXYxLy5Pd2xCb3QueWFtbCIsImgiOiIzZTgzNGI0ZTBkZjY5NTdjNzI1MjRjN2I2M2Q0MWMzMDY4ZWJjY2I0In0= --- .../google-cloud-dataproc-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-dataproc-v1/.rubocop.yml | 33 + .../google-cloud-dataproc-v1/.toys.rb | 28 + .../google-cloud-dataproc-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 ++ .../google-cloud-dataproc-v1/CHANGELOG.md | 2 + .../google-cloud-dataproc-v1/Gemfile | 11 + .../google-cloud-dataproc-v1/LICENSE.md | 201 ++ .../google-cloud-dataproc-v1/README.md | 143 ++ .../google-cloud-dataproc-v1/Rakefile | 169 ++ .../gapic_metadata.json | 301 +++ .../google-cloud-dataproc-v1.gemspec | 29 + .../lib/google-cloud-dataproc-v1.rb | 21 + .../lib/google/cloud/dataproc/v1.rb | 52 + .../dataproc/v1/autoscaling_policies_pb.rb | 59 + .../v1/autoscaling_policies_services_pb.rb | 58 + .../dataproc/v1/autoscaling_policy_service.rb | 56 + .../v1/autoscaling_policy_service/client.rb | 885 ++++++++ .../autoscaling_policy_service/credentials.rb | 51 + .../v1/autoscaling_policy_service/paths.rb | 110 + .../v1/autoscaling_policy_service/rest.rb | 54 + .../autoscaling_policy_service/rest/client.rb | 832 ++++++++ .../rest/service_stub.rb | 403 ++++ .../cloud/dataproc/v1/batch_controller.rb | 56 + .../dataproc/v1/batch_controller/client.rb | 798 ++++++++ .../v1/batch_controller/credentials.rb | 51 + .../v1/batch_controller/operations.rb | 809 ++++++++ .../dataproc/v1/batch_controller/paths.rb | 88 + .../dataproc/v1/batch_controller/rest.rb | 54 + .../v1/batch_controller/rest/client.rb | 752 +++++++ .../v1/batch_controller/rest/operations.rb | 929 +++++++++ .../v1/batch_controller/rest/service_stub.rb | 306 +++ .../google/cloud/dataproc/v1/batches_pb.rb | 64 + .../cloud/dataproc/v1/batches_services_pb.rb | 52 + .../cloud/dataproc/v1/bindings_override.rb | 257 +++ .../cloud/dataproc/v1/cluster_controller.rb | 57 + .../dataproc/v1/cluster_controller/client.rb | 1464 ++++++++++++++ .../v1/cluster_controller/credentials.rb | 51 + .../v1/cluster_controller/operations.rb | 809 ++++++++ .../dataproc/v1/cluster_controller/paths.rb | 92 + .../dataproc/v1/cluster_controller/rest.rb | 55 + .../v1/cluster_controller/rest/client.rb | 1348 +++++++++++++ .../v1/cluster_controller/rest/operations.rb | 929 +++++++++ .../cluster_controller/rest/service_stub.rb | 560 ++++++ .../google/cloud/dataproc/v1/clusters_pb.rb | 112 ++ .../cloud/dataproc/v1/clusters_services_pb.rb | 75 + .../cloud/dataproc/v1/job_controller.rb | 55 + .../dataproc/v1/job_controller/client.rb | 1192 +++++++++++ .../dataproc/v1/job_controller/credentials.rb | 51 + .../dataproc/v1/job_controller/operations.rb | 809 ++++++++ .../cloud/dataproc/v1/job_controller/rest.rb | 53 + .../dataproc/v1/job_controller/rest/client.rb | 1092 ++++++++++ .../v1/job_controller/rest/operations.rb | 929 +++++++++ .../v1/job_controller/rest/service_stub.rb | 497 +++++ .../lib/google/cloud/dataproc/v1/jobs_pb.rb | 82 + .../cloud/dataproc/v1/jobs_services_pb.rb | 62 + .../dataproc/v1/node_group_controller.rb | 57 + .../v1/node_group_controller/client.rb | 718 +++++++ .../v1/node_group_controller/credentials.rb | 51 + .../v1/node_group_controller/operations.rb | 809 ++++++++ .../v1/node_group_controller/paths.rb | 73 + .../dataproc/v1/node_group_controller/rest.rb | 55 + .../v1/node_group_controller/rest/client.rb | 679 +++++++ .../node_group_controller/rest/operations.rb | 929 +++++++++ .../rest/service_stub.rb | 248 +++ .../cloud/dataproc/v1/node_groups_pb.rb | 54 + .../dataproc/v1/node_groups_services_pb.rb | 55 + .../google/cloud/dataproc/v1/operations_pb.rb | 54 + .../lib/google/cloud/dataproc/v1/rest.rb | 45 + .../cloud/dataproc/v1/session_controller.rb | 56 + .../dataproc/v1/session_controller/client.rb | 920 +++++++++ .../v1/session_controller/credentials.rb | 51 + .../v1/session_controller/operations.rb | 809 ++++++++ .../dataproc/v1/session_controller/paths.rb | 107 + .../dataproc/v1/session_controller/rest.rb | 54 + .../v1/session_controller/rest/client.rb | 867 ++++++++ .../v1/session_controller/rest/operations.rb | 929 +++++++++ .../session_controller/rest/service_stub.rb | 366 ++++ .../v1/session_template_controller.rb | 55 + .../v1/session_template_controller/client.rb | 830 ++++++++ .../credentials.rb | 51 + .../v1/session_template_controller/paths.rb | 88 + .../v1/session_template_controller/rest.rb | 53 + .../rest/client.rb | 777 ++++++++ .../rest/service_stub.rb | 366 ++++ .../cloud/dataproc/v1/session_templates_pb.rb | 60 + .../v1/session_templates_services_pb.rb | 53 + .../google/cloud/dataproc/v1/sessions_pb.rb | 62 + .../cloud/dataproc/v1/sessions_services_pb.rb | 54 + .../lib/google/cloud/dataproc/v1/shared_pb.rb | 71 + .../lib/google/cloud/dataproc/v1/version.rb | 28 + .../dataproc/v1/workflow_template_service.rb | 57 + .../v1/workflow_template_service/client.rb | 1220 +++++++++++ .../workflow_template_service/credentials.rb | 51 + .../workflow_template_service/operations.rb | 809 ++++++++ .../v1/workflow_template_service/paths.rb | 150 ++ .../v1/workflow_template_service/rest.rb | 55 + .../workflow_template_service/rest/client.rb | 1153 +++++++++++ .../rest/operations.rb | 929 +++++++++ .../rest/service_stub.rb | 539 +++++ .../dataproc/v1/workflow_templates_pb.rb | 79 + .../v1/workflow_templates_services_pb.rb | 105 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 420 ++++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 +++ .../cloud/dataproc/v1/autoscaling_policies.rb | 296 +++ .../google/cloud/dataproc/v1/batches.rb | 367 ++++ .../google/cloud/dataproc/v1/clusters.rb | 1627 +++++++++++++++ .../google/cloud/dataproc/v1/jobs.rb | 1073 ++++++++++ .../google/cloud/dataproc/v1/node_groups.rb | 115 ++ .../google/cloud/dataproc/v1/operations.rb | 260 +++ .../cloud/dataproc/v1/session_templates.rb | 153 ++ .../google/cloud/dataproc/v1/sessions.rb | 295 +++ .../google/cloud/dataproc/v1/shared.rb | 627 ++++++ .../cloud/dataproc/v1/workflow_templates.rb | 726 +++++++ .../google/longrunning/operations.rb | 164 ++ .../proto_docs/google/protobuf/any.rb | 145 ++ .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 +++ .../proto_docs/google/protobuf/timestamp.rb | 127 ++ .../proto_docs/google/protobuf/wrappers.rb | 121 ++ .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../proto_docs/google/type/interval.rb | 45 + .../google-cloud-dataproc-v1/snippets/Gemfile | 32 + .../create_autoscaling_policy.rb | 47 + .../delete_autoscaling_policy.rb | 47 + .../get_autoscaling_policy.rb | 47 + .../list_autoscaling_policies.rb | 51 + .../update_autoscaling_policy.rb | 47 + .../snippets/batch_controller/create_batch.rb | 54 + .../snippets/batch_controller/delete_batch.rb | 47 + .../snippets/batch_controller/get_batch.rb | 47 + .../snippets/batch_controller/list_batches.rb | 51 + .../cluster_controller/create_cluster.rb | 54 + .../cluster_controller/delete_cluster.rb | 54 + .../cluster_controller/diagnose_cluster.rb | 54 + .../cluster_controller/get_cluster.rb | 47 + .../cluster_controller/list_clusters.rb | 51 + .../cluster_controller/start_cluster.rb | 54 + .../cluster_controller/stop_cluster.rb | 54 + .../cluster_controller/update_cluster.rb | 54 + .../snippets/job_controller/cancel_job.rb | 47 + .../snippets/job_controller/delete_job.rb | 47 + .../snippets/job_controller/get_job.rb | 47 + .../snippets/job_controller/list_jobs.rb | 51 + .../snippets/job_controller/submit_job.rb | 47 + .../job_controller/submit_job_as_operation.rb | 54 + .../snippets/job_controller/update_job.rb | 47 + .../create_node_group.rb | 54 + .../node_group_controller/get_node_group.rb | 47 + .../resize_node_group.rb | 54 + .../session_controller/create_session.rb | 54 + .../session_controller/delete_session.rb | 54 + .../session_controller/get_session.rb | 47 + .../session_controller/list_sessions.rb | 51 + .../session_controller/terminate_session.rb | 54 + .../create_session_template.rb | 47 + .../delete_session_template.rb | 47 + .../get_session_template.rb | 47 + .../list_session_templates.rb | 51 + .../update_session_template.rb | 47 + ...pet_metadata_google.cloud.dataproc.v1.json | 1775 +++++++++++++++++ .../create_workflow_template.rb | 47 + .../delete_workflow_template.rb | 47 + .../get_workflow_template.rb | 47 + .../instantiate_inline_workflow_template.rb | 54 + .../instantiate_workflow_template.rb | 54 + .../list_workflow_templates.rb | 51 + .../update_workflow_template.rb | 47 + .../autoscaling_policy_service_paths_test.rb | 74 + .../autoscaling_policy_service_rest_test.rb | 364 ++++ .../v1/autoscaling_policy_service_test.rb | 377 ++++ .../v1/batch_controller_operations_test.rb | 389 ++++ .../v1/batch_controller_paths_test.rb | 71 + .../dataproc/v1/batch_controller_rest_test.rb | 314 +++ .../dataproc/v1/batch_controller_test.rb | 346 ++++ .../v1/cluster_controller_operations_test.rb | 389 ++++ .../v1/cluster_controller_paths_test.rb | 71 + .../v1/cluster_controller_rest_test.rb | 558 ++++++ .../dataproc/v1/cluster_controller_test.rb | 659 ++++++ .../v1/job_controller_operations_test.rb | 389 ++++ .../dataproc/v1/job_controller_rest_test.rb | 491 +++++ .../cloud/dataproc/v1/job_controller_test.rb | 550 +++++ .../node_group_controller_operations_test.rb | 389 ++++ .../v1/node_group_controller_paths_test.rb | 59 + .../v1/node_group_controller_rest_test.rb | 259 +++ .../dataproc/v1/node_group_controller_test.rb | 286 +++ .../v1/session_controller_operations_test.rb | 389 ++++ .../v1/session_controller_paths_test.rb | 83 + .../v1/session_controller_rest_test.rb | 369 ++++ .../dataproc/v1/session_controller_test.rb | 416 ++++ .../session_template_controller_paths_test.rb | 71 + .../session_template_controller_rest_test.rb | 365 ++++ .../v1/session_template_controller_test.rb | 379 ++++ ...rkflow_template_service_operations_test.rb | 389 ++++ .../workflow_template_service_paths_test.rb | 98 + .../v1/workflow_template_service_rest_test.rb | 479 +++++ .../v1/workflow_template_service_test.rb | 531 +++++ .../google-cloud-dataproc-v1/test/helper.rb | 25 + 204 files changed, 55012 insertions(+) create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/README.md create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb create mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.gitignore b/owl-bot-staging/google-cloud-dataproc-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json new file mode 100644 index 000000000000..4ed167b07e25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "dataproc.googleapis.com", + "api_shortname": "dataproc", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dataproc-v1/latest", + "distribution_name": "google-cloud-dataproc-v1", + "is_cloud": true, + "language": "ruby", + "name": "dataproc", + "name_pretty": "Cloud Dataproc V1 API", + "product_documentation": "https://cloud.google.com/dataproc", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform. Note that google-cloud-dataproc-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dataproc instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DATAPROC", + "ruby-cloud-product-url": "https://cloud.google.com/dataproc", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml b/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml new file mode 100644 index 000000000000..3233e39a8e32 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-dataproc-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-dataproc-v1.rb" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb b/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.yardopts b/owl-bot-staging/google-cloud-dataproc-v1/.yardopts new file mode 100644 index 000000000000..dda36bca10e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Dataproc V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..bba581ee7b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-dataproc-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-dataproc-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/dataproc/v1" + +client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/dataproc/v1" + +::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-dataproc-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/dataproc/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-dataproc-v1/Gemfile b/owl-bot-staging/google-cloud-dataproc-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md b/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/owl-bot-staging/google-cloud-dataproc-v1/README.md b/owl-bot-staging/google-cloud-dataproc-v1/README.md new file mode 100644 index 000000000000..5ed2111d2a8b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/README.md @@ -0,0 +1,143 @@ +# Ruby Client for the Cloud Dataproc V1 API + +Manages Hadoop-based clusters and jobs on Google Cloud Platform. + + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Cloud Dataproc V1 API. Most users should consider using +the main client gem, +[google-cloud-dataproc](https://rubygems.org/gems/google-cloud-dataproc). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-dataproc-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/dataproc.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/dataproc/v1" + +client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +request = ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new # (request fields as keyword arguments...) +response = client.create_autoscaling_policy request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dataproc-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/dataproc) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-dataproc`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-dataproc-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-dataproc`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-dataproc-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-dataproc-v1/Rakefile b/owl-bot-staging/google-cloud-dataproc-v1/Rakefile new file mode 100644 index 000000000000..46fba621c6ef --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-dataproc-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DATAPROC_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DATAPROC_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DATAPROC_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DATAPROC_TEST_PROJECT=test123 DATAPROC_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/dataproc/v1/autoscaling_policy_service/credentials" + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DATAPROC_PROJECT"] = project + ENV["DATAPROC_TEST_PROJECT"] = project + ENV["DATAPROC_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-dataproc-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-dataproc-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-dataproc-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-dataproc-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-dataproc-v1" + header "google-cloud-dataproc-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-dataproc-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-dataproc-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-dataproc-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-dataproc-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json new file mode 100644 index 000000000000..206ae3b0a44b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json @@ -0,0 +1,301 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.dataproc.v1", + "libraryPackage": "::Google::Cloud::Dataproc::V1", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ + "create_autoscaling_policy" + ] + }, + "UpdateAutoscalingPolicy": { + "methods": [ + "update_autoscaling_policy" + ] + }, + "GetAutoscalingPolicy": { + "methods": [ + "get_autoscaling_policy" + ] + }, + "ListAutoscalingPolicies": { + "methods": [ + "list_autoscaling_policies" + ] + }, + "DeleteAutoscalingPolicy": { + "methods": [ + "delete_autoscaling_policy" + ] + } + } + } + } + }, + "BatchController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::BatchController::Client", + "rpcs": { + "CreateBatch": { + "methods": [ + "create_batch" + ] + }, + "GetBatch": { + "methods": [ + "get_batch" + ] + }, + "ListBatches": { + "methods": [ + "list_batches" + ] + }, + "DeleteBatch": { + "methods": [ + "delete_batch" + ] + } + } + } + } + }, + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::ClusterController::Client", + "rpcs": { + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "StopCluster": { + "methods": [ + "stop_cluster" + ] + }, + "StartCluster": { + "methods": [ + "start_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "DiagnoseCluster": { + "methods": [ + "diagnose_cluster" + ] + } + } + } + } + }, + "JobController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::JobController::Client", + "rpcs": { + "SubmitJob": { + "methods": [ + "submit_job" + ] + }, + "SubmitJobAsOperation": { + "methods": [ + "submit_job_as_operation" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "CancelJob": { + "methods": [ + "cancel_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + } + } + } + } + }, + "NodeGroupController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client", + "rpcs": { + "CreateNodeGroup": { + "methods": [ + "create_node_group" + ] + }, + "ResizeNodeGroup": { + "methods": [ + "resize_node_group" + ] + }, + "GetNodeGroup": { + "methods": [ + "get_node_group" + ] + } + } + } + } + }, + "SessionController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::SessionController::Client", + "rpcs": { + "CreateSession": { + "methods": [ + "create_session" + ] + }, + "GetSession": { + "methods": [ + "get_session" + ] + }, + "ListSessions": { + "methods": [ + "list_sessions" + ] + }, + "TerminateSession": { + "methods": [ + "terminate_session" + ] + }, + "DeleteSession": { + "methods": [ + "delete_session" + ] + } + } + } + } + }, + "SessionTemplateController": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client", + "rpcs": { + "CreateSessionTemplate": { + "methods": [ + "create_session_template" + ] + }, + "UpdateSessionTemplate": { + "methods": [ + "update_session_template" + ] + }, + "GetSessionTemplate": { + "methods": [ + "get_session_template" + ] + }, + "ListSessionTemplates": { + "methods": [ + "list_session_templates" + ] + }, + "DeleteSessionTemplate": { + "methods": [ + "delete_session_template" + ] + } + } + } + } + }, + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ + "create_workflow_template" + ] + }, + "GetWorkflowTemplate": { + "methods": [ + "get_workflow_template" + ] + }, + "InstantiateWorkflowTemplate": { + "methods": [ + "instantiate_workflow_template" + ] + }, + "InstantiateInlineWorkflowTemplate": { + "methods": [ + "instantiate_inline_workflow_template" + ] + }, + "UpdateWorkflowTemplate": { + "methods": [ + "update_workflow_template" + ] + }, + "ListWorkflowTemplates": { + "methods": [ + "list_workflow_templates" + ] + }, + "DeleteWorkflowTemplate": { + "methods": [ + "delete_workflow_template" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec b/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec new file mode 100644 index 000000000000..6b21d6df6491 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/dataproc/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-dataproc-v1" + gem.version = Google::Cloud::Dataproc::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages Hadoop-based clusters and jobs on Google Cloud Platform. Note that google-cloud-dataproc-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dataproc instead. See the readme for more details." + gem.summary = "Manages Hadoop-based clusters and jobs on Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb new file mode 100644 index 000000000000..cf5b3cf47f1c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/dataproc/v1" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb new file mode 100644 index 000000000000..3cec95165d69 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/autoscaling_policy_service" +require "google/cloud/dataproc/v1/batch_controller" +require "google/cloud/dataproc/v1/cluster_controller" +require "google/cloud/dataproc/v1/job_controller" +require "google/cloud/dataproc/v1/node_group_controller" +require "google/cloud/dataproc/v1/session_controller" +require "google/cloud/dataproc/v1/session_template_controller" +require "google/cloud/dataproc/v1/workflow_template_service" +require "google/cloud/dataproc/v1/version" + +module Google + module Cloud + module Dataproc + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1" + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/dataproc/v1" + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/dataproc/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb new file mode 100644 index 000000000000..8657a00c1c8d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/autoscaling_policies.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n3google/cloud/dataproc/v1/autoscaling_policies.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xa5\x05\n\x11\x41utoscalingPolicy\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12S\n\x0f\x62\x61sic_algorithm\x18\x03 \x01(\x0b\x32\x33.google.cloud.dataproc.v1.BasicAutoscalingAlgorithmB\x03\xe0\x41\x02H\x00\x12Z\n\rworker_config\x18\x04 \x01(\x0b\x32>.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfigB\x03\xe0\x41\x02\x12\x64\n\x17secondary_worker_config\x18\x05 \x01(\x0b\x32>.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfigB\x03\xe0\x41\x01\x12L\n\x06labels\x18\x06 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.AutoscalingPolicy.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xcf\x01\xea\x41\xcb\x01\n)dataproc.googleapis.com/AutoscalingPolicy\x12Pprojects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}\x12Lprojects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}B\x0b\n\talgorithm\"\xb0\x01\n\x19\x42\x61sicAutoscalingAlgorithm\x12P\n\x0byarn_config\x18\x01 \x01(\x0b\x32\x34.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigB\x03\xe0\x41\x02H\x00\x12\x37\n\x0f\x63ooldown_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\"\xf9\x01\n\x1a\x42\x61sicYarnAutoscalingConfig\x12\x45\n\x1dgraceful_decommission_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x1c\n\x0fscale_up_factor\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12\x1e\n\x11scale_down_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x02\x12)\n\x1cscale_up_min_worker_fraction\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12+\n\x1escale_down_min_worker_fraction\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01\"s\n$InstanceGroupAutoscalingPolicyConfig\x12\x1a\n\rmin_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1a\n\rmax_instances\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x13\n\x06weight\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xa5\x01\n\x1e\x43reateAutoscalingPolicyRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dataproc.googleapis.com/AutoscalingPolicy\x12@\n\x06policy\x18\x02 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x02\"^\n\x1bGetAutoscalingPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dataproc.googleapis.com/AutoscalingPolicy\"b\n\x1eUpdateAutoscalingPolicyRequest\x12@\n\x06policy\x18\x01 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x02\"a\n\x1e\x44\x65leteAutoscalingPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dataproc.googleapis.com/AutoscalingPolicy\"\x94\x01\n\x1eListAutoscalingPoliciesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dataproc.googleapis.com/AutoscalingPolicy\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x83\x01\n\x1fListAutoscalingPoliciesResponse\x12\x42\n\x08policies\x18\x01 \x03(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x32\xae\x0b\n\x18\x41utoscalingPolicyService\x12\x9c\x02\n\x17\x43reateAutoscalingPolicy\x12\x38.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest\x1a+.google.cloud.dataproc.v1.AutoscalingPolicy\"\x99\x01\xda\x41\rparent,policy\x82\xd3\xe4\x93\x02\x82\x01\"7/v1/{parent=projects/*/locations/*}/autoscalingPolicies:\x06policyZ?\"5/v1/{parent=projects/*/regions/*}/autoscalingPolicies:\x06policy\x12\xa3\x02\n\x17UpdateAutoscalingPolicy\x12\x38.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest\x1a+.google.cloud.dataproc.v1.AutoscalingPolicy\"\xa0\x01\xda\x41\x06policy\x82\xd3\xe4\x93\x02\x90\x01\x1a>/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}:\x06policyZF\x1a e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates (replaces) autoscaling policy. + # + # Disabled check for update_mask, because all updates will be full + # replacements. + # + # @overload update_autoscaling_policy(request, options = nil) + # Pass arguments to `update_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_autoscaling_policy(policy: nil) + # Pass arguments to `update_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] + # Required. The updated autoscaling policy. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new + # + # # Call the update_autoscaling_policy method. + # result = client.update_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # + def update_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.policy&.name + header_params["policy.name"] = request.policy.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_autoscaling_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.call_rpc :update_autoscaling_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves autoscaling policy. + # + # @overload get_autoscaling_policy(request, options = nil) + # Pass arguments to `get_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_autoscaling_policy(name: nil) + # Pass arguments to `get_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new + # + # # Call the get_autoscaling_policy method. + # result = client.get_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # + def get_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_autoscaling_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.call_rpc :get_autoscaling_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists autoscaling policies in the project. + # + # @overload list_autoscaling_policies(request, options = nil) + # Pass arguments to `list_autoscaling_policies` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_autoscaling_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The "resource name" of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.list`, the resource name + # of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.autoscalingPolicies.list`, the resource name + # of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in each response. + # Must be less than or equal to 1000. Defaults to 100. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new + # + # # Call the list_autoscaling_policies method. + # result = client.list_autoscaling_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p item + # end + # + def list_autoscaling_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_autoscaling_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_autoscaling_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_autoscaling_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.call_rpc :list_autoscaling_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @autoscaling_policy_service_stub, :list_autoscaling_policies, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an autoscaling policy. It is an error to delete an autoscaling + # policy that is in use by one or more clusters. + # + # @overload delete_autoscaling_policy(request, options = nil) + # Pass arguments to `delete_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_autoscaling_policy(name: nil) + # Pass arguments to `delete_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new + # + # # Call the delete_autoscaling_policy method. + # result = client.delete_autoscaling_policy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_autoscaling_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.call_rpc :delete_autoscaling_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AutoscalingPolicyService API. + # + # This class represents the configuration for AutoscalingPolicyService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_autoscaling_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_autoscaling_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_autoscaling_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the AutoscalingPolicyService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_autoscaling_policy + ## + # RPC-specific configuration for `update_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_autoscaling_policy + ## + # RPC-specific configuration for `get_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_autoscaling_policy + ## + # RPC-specific configuration for `list_autoscaling_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_autoscaling_policies + ## + # RPC-specific configuration for `delete_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_autoscaling_policy + + # @private + def initialize parent_rpcs = nil + create_autoscaling_policy_config = parent_rpcs.create_autoscaling_policy if parent_rpcs.respond_to? :create_autoscaling_policy + @create_autoscaling_policy = ::Gapic::Config::Method.new create_autoscaling_policy_config + update_autoscaling_policy_config = parent_rpcs.update_autoscaling_policy if parent_rpcs.respond_to? :update_autoscaling_policy + @update_autoscaling_policy = ::Gapic::Config::Method.new update_autoscaling_policy_config + get_autoscaling_policy_config = parent_rpcs.get_autoscaling_policy if parent_rpcs.respond_to? :get_autoscaling_policy + @get_autoscaling_policy = ::Gapic::Config::Method.new get_autoscaling_policy_config + list_autoscaling_policies_config = parent_rpcs.list_autoscaling_policies if parent_rpcs.respond_to? :list_autoscaling_policies + @list_autoscaling_policies = ::Gapic::Config::Method.new list_autoscaling_policies_config + delete_autoscaling_policy_config = parent_rpcs.delete_autoscaling_policy if parent_rpcs.respond_to? :delete_autoscaling_policy + @delete_autoscaling_policy = ::Gapic::Config::Method.new delete_autoscaling_policy_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb new file mode 100644 index 000000000000..8d418f849925 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module AutoscalingPolicyService + # Credentials for the AutoscalingPolicyService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb new file mode 100644 index 000000000000..295a26b78f18 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module AutoscalingPolicyService + # Path helper methods for the AutoscalingPolicyService API. + module Paths + ## + # Create a fully-qualified AutoscalingPolicy resource string. + # + # @overload autoscaling_policy_path(project:, location:, autoscaling_policy:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}` + # + # @param project [String] + # @param location [String] + # @param autoscaling_policy [String] + # + # @overload autoscaling_policy_path(project:, region:, autoscaling_policy:) + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}` + # + # @param project [String] + # @param region [String] + # @param autoscaling_policy [String] + # + # @return [::String] + def autoscaling_policy_path **args + resources = { + "autoscaling_policy:location:project" => (proc do |project:, location:, autoscaling_policy:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/autoscalingPolicies/#{autoscaling_policy}" + end), + "autoscaling_policy:project:region" => (proc do |project:, region:, autoscaling_policy:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/autoscalingPolicies/#{autoscaling_policy}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Region resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}` + # + # @param project [String] + # @param region [String] + # + # @return [::String] + def region_path project:, region: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/regions/#{region}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb new file mode 100644 index 000000000000..50c6318edc47 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/autoscaling_policy_service/credentials" +require "google/cloud/dataproc/v1/autoscaling_policy_service/paths" +require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The API interface for managing autoscaling policies in the + # Dataproc API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + module AutoscalingPolicyService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb new file mode 100644 index 000000000000..fe3183179f15 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb @@ -0,0 +1,832 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/autoscaling_policies_pb" +require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module AutoscalingPolicyService + module Rest + ## + # REST client for the AutoscalingPolicyService service. + # + # The API interface for managing autoscaling policies in the + # Dataproc API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :autoscaling_policy_service_stub + + ## + # Configure the AutoscalingPolicyService Client class. + # + # See {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AutoscalingPolicyService clients + # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_autoscaling_policy.timeout = 600.0 + + default_config.rpcs.update_autoscaling_policy.timeout = 600.0 + default_config.rpcs.update_autoscaling_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_autoscaling_policy.timeout = 600.0 + default_config.rpcs.get_autoscaling_policy.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_autoscaling_policies.timeout = 600.0 + default_config.rpcs.list_autoscaling_policies.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.delete_autoscaling_policy.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AutoscalingPolicyService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @autoscaling_policy_service_stub.universe_domain + end + + ## + # Create a new AutoscalingPolicyService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AutoscalingPolicyService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @autoscaling_policy_service_stub = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @autoscaling_policy_service_stub.endpoint + config.universe_domain = @autoscaling_policy_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates new autoscaling policy. + # + # @overload create_autoscaling_policy(request, options = nil) + # Pass arguments to `create_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_autoscaling_policy(parent: nil, policy: nil) + # Pass arguments to `create_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The "resource name" of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.create`, the resource name + # of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.autoscalingPolicies.create`, the resource name + # of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] + # Required. The autoscaling policy to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new + # + # # Call the create_autoscaling_policy method. + # result = client.create_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # + def create_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_autoscaling_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.create_autoscaling_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates (replaces) autoscaling policy. + # + # Disabled check for update_mask, because all updates will be full + # replacements. + # + # @overload update_autoscaling_policy(request, options = nil) + # Pass arguments to `update_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_autoscaling_policy(policy: nil) + # Pass arguments to `update_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] + # Required. The updated autoscaling policy. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new + # + # # Call the update_autoscaling_policy method. + # result = client.update_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # + def update_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_autoscaling_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.update_autoscaling_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves autoscaling policy. + # + # @overload get_autoscaling_policy(request, options = nil) + # Pass arguments to `get_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_autoscaling_policy(name: nil) + # Pass arguments to `get_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new + # + # # Call the get_autoscaling_policy method. + # result = client.get_autoscaling_policy request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p result + # + def get_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_autoscaling_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.get_autoscaling_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists autoscaling policies in the project. + # + # @overload list_autoscaling_policies(request, options = nil) + # Pass arguments to `list_autoscaling_policies` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_autoscaling_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The "resource name" of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.list`, the resource name + # of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.autoscalingPolicies.list`, the resource name + # of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in each response. + # Must be less than or equal to 1000. Defaults to 100. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new + # + # # Call the list_autoscaling_policies method. + # result = client.list_autoscaling_policies request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. + # p item + # end + # + def list_autoscaling_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_autoscaling_policies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_autoscaling_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_autoscaling_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.list_autoscaling_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @autoscaling_policy_service_stub, :list_autoscaling_policies, "policies", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an autoscaling policy. It is an error to delete an autoscaling + # policy that is in use by one or more clusters. + # + # @overload delete_autoscaling_policy(request, options = nil) + # Pass arguments to `delete_autoscaling_policy` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_autoscaling_policy(name: nil) + # Pass arguments to `delete_autoscaling_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new + # + # # Call the delete_autoscaling_policy method. + # result = client.delete_autoscaling_policy request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_autoscaling_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_autoscaling_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_autoscaling_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_autoscaling_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @autoscaling_policy_service_stub.delete_autoscaling_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the AutoscalingPolicyService REST API. + # + # This class represents the configuration for AutoscalingPolicyService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_autoscaling_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_autoscaling_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_autoscaling_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the AutoscalingPolicyService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_autoscaling_policy + ## + # RPC-specific configuration for `update_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_autoscaling_policy + ## + # RPC-specific configuration for `get_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_autoscaling_policy + ## + # RPC-specific configuration for `list_autoscaling_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_autoscaling_policies + ## + # RPC-specific configuration for `delete_autoscaling_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_autoscaling_policy + + # @private + def initialize parent_rpcs = nil + create_autoscaling_policy_config = parent_rpcs.create_autoscaling_policy if parent_rpcs.respond_to? :create_autoscaling_policy + @create_autoscaling_policy = ::Gapic::Config::Method.new create_autoscaling_policy_config + update_autoscaling_policy_config = parent_rpcs.update_autoscaling_policy if parent_rpcs.respond_to? :update_autoscaling_policy + @update_autoscaling_policy = ::Gapic::Config::Method.new update_autoscaling_policy_config + get_autoscaling_policy_config = parent_rpcs.get_autoscaling_policy if parent_rpcs.respond_to? :get_autoscaling_policy + @get_autoscaling_policy = ::Gapic::Config::Method.new get_autoscaling_policy_config + list_autoscaling_policies_config = parent_rpcs.list_autoscaling_policies if parent_rpcs.respond_to? :list_autoscaling_policies + @list_autoscaling_policies = ::Gapic::Config::Method.new list_autoscaling_policies_config + delete_autoscaling_policy_config = parent_rpcs.delete_autoscaling_policy if parent_rpcs.respond_to? :delete_autoscaling_policy + @delete_autoscaling_policy = ::Gapic::Config::Method.new delete_autoscaling_policy_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb new file mode 100644 index 000000000000..e651fc81bc9a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/autoscaling_policies_pb" + +module Google + module Cloud + module Dataproc + module V1 + module AutoscalingPolicyService + module Rest + ## + # REST service stub for the AutoscalingPolicyService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # A result object deserialized from the server's reply + def create_autoscaling_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_autoscaling_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # A result object deserialized from the server's reply + def update_autoscaling_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_autoscaling_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # A result object deserialized from the server's reply + def get_autoscaling_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_autoscaling_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_autoscaling_policies REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse] + # A result object deserialized from the server's reply + def list_autoscaling_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_autoscaling_policies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_autoscaling_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_autoscaling_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_autoscaling_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/autoscalingPolicies", + body: "policy", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/autoscalingPolicies", + body: "policy", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_autoscaling_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :put, + uri_template: "/v1/{policy.name}", + body: "policy", + matches: [ + ["policy.name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :put, + uri_template: "/v1/{policy.name}", + body: "policy", + matches: [ + ["policy.name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_autoscaling_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_autoscaling_policies REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_autoscaling_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/autoscalingPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/autoscalingPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_autoscaling_policy REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_autoscaling_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb new file mode 100644 index 000000000000..92abf22391f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/batch_controller/credentials" +require "google/cloud/dataproc/v1/batch_controller/paths" +require "google/cloud/dataproc/v1/batch_controller/operations" +require "google/cloud/dataproc/v1/batch_controller/client" +require "google/cloud/dataproc/v1/batch_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The BatchController provides methods to manage batch workloads. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/batch_controller" + # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/batch_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + module BatchController + end + end + end + end +end + +helper_path = ::File.join __dir__, "batch_controller", "helpers.rb" +require "google/cloud/dataproc/v1/batch_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb new file mode 100644 index 000000000000..c8287a1b4349 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb @@ -0,0 +1,798 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/batches_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + ## + # Client for the BatchController service. + # + # The BatchController provides methods to manage batch workloads. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :batch_controller_stub + + ## + # Configure the BatchController Client class. + # + # See {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BatchController clients + # ::Google::Cloud::Dataproc::V1::BatchController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @batch_controller_stub.universe_domain + end + + ## + # Create a new BatchController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BatchController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/batches_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @batch_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::BatchController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_controller_stub.endpoint + config.universe_domain = @batch_controller_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::BatchController::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a batch workload that executes asynchronously. + # + # @overload create_batch(request, options = nil) + # Pass arguments to `create_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_batch(parent: nil, batch: nil, batch_id: nil, request_id: nil) + # Pass arguments to `create_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this batch will be created. + # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash] + # Required. The batch to create. + # @param batch_id [::String] + # Optional. The ID to use for the batch, which will become the final + # component of the batch's resource name. + # + # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + # with the same request_id, the second request is ignored and the + # Operation that corresponds to the first Batch created and stored + # in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new + # + # # Call the create_batch method. + # result = client.create_batch request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_batch.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.call_rpc :create_batch, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the batch workload resource representation. + # + # @overload get_batch(request, options = nil) + # Pass arguments to `get_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_batch(name: nil) + # Pass arguments to `get_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Batch] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Batch] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new + # + # # Call the get_batch method. + # result = client.get_batch request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Batch. + # p result + # + def get_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_batch.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.call_rpc :get_batch, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists batch workloads. + # + # @overload list_batches(request, options = nil) + # Pass arguments to `list_batches` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListBatchesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_batches` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of batches. + # @param page_size [::Integer] + # Optional. The maximum number of batches to return in each response. + # The service may return fewer than this value. + # The default page size is 20; the maximum page size is 1000. + # @param page_token [::String] + # Optional. A page token received from a previous `ListBatches` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the batches to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each batch resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND/OR). + # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + # + # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + # filters for batches in state RUNNING that were created before 2023-01-01 + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparisons. + # @param order_by [::String] + # Optional. Field(s) on which to sort the list of batches. + # + # Currently the only supported sort orders are unspecified (empty) and + # `create_time desc` to sort by most recently created batches first. + # + # See https://google.aip.dev/132#ordering for more details. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new + # + # # Call the list_batches method. + # result = client.list_batches request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. + # p item + # end + # + def list_batches request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_batches.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_batches.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_batches.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.call_rpc :list_batches, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @batch_controller_stub, :list_batches, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the batch workload resource. If the batch is not in terminal state, + # the delete fails and the response returns `FAILED_PRECONDITION`. + # + # @overload delete_batch(request, options = nil) + # Pass arguments to `delete_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_batch(name: nil) + # Pass arguments to `delete_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new + # + # # Call the delete_batch method. + # result = client.delete_batch request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_batch.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.call_rpc :delete_batch, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BatchController API. + # + # This class represents the configuration for BatchController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_batch to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::BatchController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_batch.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_batch.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BatchController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :create_batch + ## + # RPC-specific configuration for `get_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :get_batch + ## + # RPC-specific configuration for `list_batches` + # @return [::Gapic::Config::Method] + # + attr_reader :list_batches + ## + # RPC-specific configuration for `delete_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_batch + + # @private + def initialize parent_rpcs = nil + create_batch_config = parent_rpcs.create_batch if parent_rpcs.respond_to? :create_batch + @create_batch = ::Gapic::Config::Method.new create_batch_config + get_batch_config = parent_rpcs.get_batch if parent_rpcs.respond_to? :get_batch + @get_batch = ::Gapic::Config::Method.new get_batch_config + list_batches_config = parent_rpcs.list_batches if parent_rpcs.respond_to? :list_batches + @list_batches = ::Gapic::Config::Method.new list_batches_config + delete_batch_config = parent_rpcs.delete_batch if parent_rpcs.respond_to? :delete_batch + @delete_batch = ::Gapic::Config::Method.new delete_batch_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb new file mode 100644 index 000000000000..ff47be3120b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + # Credentials for the BatchController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb new file mode 100644 index 000000000000..2226d12ab9fa --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BatchController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb new file mode 100644 index 000000000000..2e74bdb1ef39 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + # Path helper methods for the BatchController API. + module Paths + ## + # Create a fully-qualified Batch resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/batches/{batch}` + # + # @param project [String] + # @param location [String] + # @param batch [String] + # + # @return [::String] + def batch_path project:, location:, batch: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/batches/#{batch}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb new file mode 100644 index 000000000000..c0553a98dab7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/batch_controller/credentials" +require "google/cloud/dataproc/v1/batch_controller/paths" +require "google/cloud/dataproc/v1/batch_controller/rest/operations" +require "google/cloud/dataproc/v1/batch_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The BatchController provides methods to manage batch workloads. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/batch_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + module BatchController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/batch_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb new file mode 100644 index 000000000000..59200044b3f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb @@ -0,0 +1,752 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/batches_pb" +require "google/cloud/dataproc/v1/batch_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + module Rest + ## + # REST client for the BatchController service. + # + # The BatchController provides methods to manage batch workloads. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :batch_controller_stub + + ## + # Configure the BatchController Client class. + # + # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BatchController clients + # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @batch_controller_stub.universe_domain + end + + ## + # Create a new BatchController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BatchController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @batch_controller_stub = ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_controller_stub.endpoint + config.universe_domain = @batch_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a batch workload that executes asynchronously. + # + # @overload create_batch(request, options = nil) + # Pass arguments to `create_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_batch(parent: nil, batch: nil, batch_id: nil, request_id: nil) + # Pass arguments to `create_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this batch will be created. + # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash] + # Required. The batch to create. + # @param batch_id [::String] + # Optional. The ID to use for the batch, which will become the final + # component of the batch's resource name. + # + # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + # with the same request_id, the second request is ignored and the + # Operation that corresponds to the first Batch created and stored + # in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new + # + # # Call the create_batch method. + # result = client.create_batch request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_batch.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.create_batch request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the batch workload resource representation. + # + # @overload get_batch(request, options = nil) + # Pass arguments to `get_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_batch(name: nil) + # Pass arguments to `get_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Batch] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Batch] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new + # + # # Call the get_batch method. + # result = client.get_batch request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Batch. + # p result + # + def get_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_batch.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.get_batch request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists batch workloads. + # + # @overload list_batches(request, options = nil) + # Pass arguments to `list_batches` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListBatchesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_batches` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of batches. + # @param page_size [::Integer] + # Optional. The maximum number of batches to return in each response. + # The service may return fewer than this value. + # The default page size is 20; the maximum page size is 1000. + # @param page_token [::String] + # Optional. A page token received from a previous `ListBatches` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the batches to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each batch resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND/OR). + # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + # + # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + # filters for batches in state RUNNING that were created before 2023-01-01 + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparisons. + # @param order_by [::String] + # Optional. Field(s) on which to sort the list of batches. + # + # Currently the only supported sort orders are unspecified (empty) and + # `create_time desc` to sort by most recently created batches first. + # + # See https://google.aip.dev/132#ordering for more details. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new + # + # # Call the list_batches method. + # result = client.list_batches request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. + # p item + # end + # + def list_batches request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_batches.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_batches.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_batches.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.list_batches request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @batch_controller_stub, :list_batches, "batches", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the batch workload resource. If the batch is not in terminal state, + # the delete fails and the response returns `FAILED_PRECONDITION`. + # + # @overload delete_batch(request, options = nil) + # Pass arguments to `delete_batch` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteBatchRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_batch(name: nil) + # Pass arguments to `delete_batch` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new + # + # # Call the delete_batch method. + # result = client.delete_batch request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_batch request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_batch.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_batch.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_batch.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_controller_stub.delete_batch request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BatchController REST API. + # + # This class represents the configuration for BatchController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_batch to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_batch.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_batch.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the BatchController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :create_batch + ## + # RPC-specific configuration for `get_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :get_batch + ## + # RPC-specific configuration for `list_batches` + # @return [::Gapic::Config::Method] + # + attr_reader :list_batches + ## + # RPC-specific configuration for `delete_batch` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_batch + + # @private + def initialize parent_rpcs = nil + create_batch_config = parent_rpcs.create_batch if parent_rpcs.respond_to? :create_batch + @create_batch = ::Gapic::Config::Method.new create_batch_config + get_batch_config = parent_rpcs.get_batch if parent_rpcs.respond_to? :get_batch + @get_batch = ::Gapic::Config::Method.new get_batch_config + list_batches_config = parent_rpcs.list_batches if parent_rpcs.respond_to? :list_batches + @list_batches = ::Gapic::Config::Method.new list_batches_config + delete_batch_config = parent_rpcs.delete_batch if parent_rpcs.respond_to? :delete_batch + @delete_batch = ::Gapic::Config::Method.new delete_batch_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb new file mode 100644 index 000000000000..b073ae3df6fb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BatchController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb new file mode 100644 index 000000000000..e9609f7fcdcb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb @@ -0,0 +1,306 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/batches_pb" + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + module Rest + ## + # REST service stub for the BatchController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateBatchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_batch request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_batch_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetBatchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Batch] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Batch] + # A result object deserialized from the server's reply + def get_batch request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_batch_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Batch.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_batches REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListBatchesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListBatchesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListBatchesResponse] + # A result object deserialized from the server's reply + def list_batches request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_batches_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteBatchRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_batch request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_batch_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateBatchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_batch_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/batches", + body: "batch", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetBatchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_batch_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/batches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_batches REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListBatchesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_batches_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/batches", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_batch REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteBatchRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_batch_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/batches/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb new file mode 100644 index 000000000000..031fce32060b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/batches.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/shared_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/cloud/dataproc/v1/batches.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb0\x01\n\x12\x43reateBatchRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x64\x61taproc.googleapis.com/Batch\x12\x33\n\x05\x62\x61tch\x18\x02 \x01(\x0b\x32\x1f.google.cloud.dataproc.v1.BatchB\x03\xe0\x41\x02\x12\x15\n\x08\x62\x61tch_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"F\n\x0fGetBatchRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64\x61taproc.googleapis.com/Batch\"\xa8\x01\n\x12ListBatchesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x64\x61taproc.googleapis.com/Batch\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"`\n\x13ListBatchesResponse\x12\x30\n\x07\x62\x61tches\x18\x01 \x03(\x0b\x32\x1f.google.cloud.dataproc.v1.Batch\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x12\x44\x65leteBatchRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64\x61taproc.googleapis.com/Batch\"\xc8\n\n\x05\x42\x61tch\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x44\n\rpyspark_batch\x18\x04 \x01(\x0b\x32&.google.cloud.dataproc.v1.PySparkBatchB\x03\xe0\x41\x01H\x00\x12@\n\x0bspark_batch\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.SparkBatchB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_r_batch\x18\x06 \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkRBatchB\x03\xe0\x41\x01H\x00\x12G\n\x0fspark_sql_batch\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.SparkSqlBatchB\x03\xe0\x41\x01H\x00\x12@\n\x0cruntime_info\x18\x08 \x01(\x0b\x32%.google.cloud.dataproc.v1.RuntimeInfoB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\t \x01(\x0e\x32%.google.cloud.dataproc.v1.Batch.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07\x63reator\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12@\n\x06labels\x18\r \x03(\x0b\x32+.google.cloud.dataproc.v1.Batch.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\x0f \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x16\n\toperation\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12H\n\rstate_history\x18\x11 \x03(\x0b\x32,.google.cloud.dataproc.v1.Batch.StateHistoryB\x03\xe0\x41\x03\x1a\xa0\x01\n\x0cStateHistory\x12\x39\n\x05state\x18\x01 \x01(\x0e\x32%.google.cloud.dataproc.v1.Batch.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06:[\xea\x41X\n\x1d\x64\x61taproc.googleapis.com/Batch\x12\x37projects/{project}/locations/{location}/batches/{batch}B\x0e\n\x0c\x62\x61tch_config\"\xb2\x01\n\x0cPySparkBatch\x12!\n\x14main_python_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10python_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\"\xb5\x01\n\nSparkBatch\x12 \n\x11main_jar_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x19\n\nmain_class\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x42\x08\n\x06\x64river\"q\n\x0bSparkRBatch\x12\x1c\n\x0fmain_r_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\"\xda\x01\n\rSparkSqlBatch\x12\x1b\n\x0equery_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\x0fquery_variables\x18\x02 \x03(\x0b\x32;.google.cloud.dataproc.v1.SparkSqlBatch.QueryVariablesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13QueryVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\x9d\x06\n\x0f\x42\x61tchController\x12\xea\x01\n\x0b\x43reateBatch\x12,.google.cloud.dataproc.v1.CreateBatchRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x38\n\x05\x42\x61tch\x12/google.cloud.dataproc.v1.BatchOperationMetadata\xda\x41\x15parent,batch,batch_id\x82\xd3\xe4\x93\x02\x34\"+/v1/{parent=projects/*/locations/*}/batches:\x05\x62\x61tch\x12\x92\x01\n\x08GetBatch\x12).google.cloud.dataproc.v1.GetBatchRequest\x1a\x1f.google.cloud.dataproc.v1.Batch\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/batches/*}\x12\xa8\x01\n\x0bListBatches\x12,.google.cloud.dataproc.v1.ListBatchesRequest\x1a-.google.cloud.dataproc.v1.ListBatchesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/batches\x12\x8f\x01\n\x0b\x44\x65leteBatch\x12,.google.cloud.dataproc.v1.DeleteBatchRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/batches/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBk\n\x1c\x63om.google.cloud.dataproc.v1B\x0c\x42\x61tchesProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dataproc.v1.RuntimeInfo", "google/cloud/dataproc/v1/shared.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + CreateBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateBatchRequest").msgclass + GetBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetBatchRequest").msgclass + ListBatchesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListBatchesRequest").msgclass + ListBatchesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListBatchesResponse").msgclass + DeleteBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteBatchRequest").msgclass + Batch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch").msgclass + Batch::StateHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch.StateHistory").msgclass + Batch::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch.State").enummodule + PySparkBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PySparkBatch").msgclass + SparkBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkBatch").msgclass + SparkRBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkRBatch").msgclass + SparkSqlBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkSqlBatch").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb new file mode 100644 index 000000000000..5da1b888618f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/batches.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/batches_pb' + +module Google + module Cloud + module Dataproc + module V1 + module BatchController + # The BatchController provides methods to manage batch workloads. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.BatchController' + + # Creates a batch workload that executes asynchronously. + rpc :CreateBatch, ::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Google::Longrunning::Operation + # Gets the batch workload resource representation. + rpc :GetBatch, ::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Google::Cloud::Dataproc::V1::Batch + # Lists batch workloads. + rpc :ListBatches, ::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Google::Cloud::Dataproc::V1::ListBatchesResponse + # Deletes the batch workload resource. If the batch is not in terminal state, + # the delete fails and the response returns `FAILED_PRECONDITION`. + rpc :DeleteBatch, ::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb new file mode 100644 index 000000000000..7a01a2d2075d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb @@ -0,0 +1,257 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module Dataproc + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/dataproc/v1/rest" + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = Configuration.new parent_config + default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.cloud.dataproc.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.dataproc.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb new file mode 100644 index 000000000000..c489bcb25bdb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/cluster_controller/credentials" +require "google/cloud/dataproc/v1/cluster_controller/paths" +require "google/cloud/dataproc/v1/cluster_controller/operations" +require "google/cloud/dataproc/v1/cluster_controller/client" +require "google/cloud/dataproc/v1/cluster_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The ClusterControllerService provides methods to manage clusters + # of Compute Engine instances. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/cluster_controller" + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/cluster_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + module ClusterController + end + end + end + end +end + +helper_path = ::File.join __dir__, "cluster_controller", "helpers.rb" +require "google/cloud/dataproc/v1/cluster_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb new file mode 100644 index 000000000000..89899559790b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb @@ -0,0 +1,1464 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/clusters_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + ## + # Client for the ClusterController service. + # + # The ClusterControllerService provides methods to manage clusters + # of Compute Engine instances. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cluster_controller_stub + + ## + # Configure the ClusterController Client class. + # + # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ClusterController clients + # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_cluster.timeout = 300.0 + default_config.rpcs.create_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_cluster.timeout = 300.0 + default_config.rpcs.update_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_cluster.timeout = 300.0 + default_config.rpcs.delete_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 300.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] + } + + default_config.rpcs.list_clusters.timeout = 300.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] + } + + default_config.rpcs.diagnose_cluster.timeout = 300.0 + default_config.rpcs.diagnose_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ClusterController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cluster_controller_stub.universe_domain + end + + ## + # Create a new ClusterController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ClusterController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/clusters_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cluster_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::ClusterController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cluster_controller_stub.endpoint + config.universe_domain = @cluster_controller_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::ClusterController::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil, action_on_failed_primary_workers: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] + # Required. The cluster to create. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param action_on_failed_primary_workers [::Google::Cloud::Dataproc::V1::FailureAction] + # Optional. Failure action when primary worker creation fails. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :create_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # The cluster must be in a + # {::Google::Cloud::Dataproc::V1::ClusterStatus::State `RUNNING`} state or an error + # is returned. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_cluster(project_id: nil, region: nil, cluster_name: nil, cluster: nil, graceful_decommission_timeout: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] + # Required. The changes to the cluster. + # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] + # Optional. Timeout for graceful YARN decommissioning. Graceful + # decommissioning allows removing nodes from the cluster without + # interrupting jobs in progress. Timeout specifies how long to wait for jobs + # in progress to finish before forcefully removing nodes (and potentially + # interrupting jobs). Default timeout is 0 (for forceful decommission), and + # the maximum allowed timeout is 1 day. (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the path, relative to `Cluster`, of + # the field to update. For example, to change the number of workers + # in a cluster to 5, the `update_mask` parameter would be + # specified as `config.worker_config.num_instances`, + # and the `PATCH` request body would specify the new value, as follows: + # + # { + # "config":{ + # "workerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Similarly, to change the number of preemptible workers in a cluster to 5, + # the `update_mask` parameter would be + # `config.secondary_worker_config.num_instances`, and the `PATCH` request + # body would be set as follows: + # + # { + # "config":{ + # "secondaryWorkerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Note: Currently, only the following fields can be updated: + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + # change autoscaling policies
+ # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :update_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops a cluster in a project. + # + # @overload stop_cluster(request, options = nil) + # Pass arguments to `stop_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::StopClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `stop_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new + # + # # Call the stop_cluster method. + # result = client.stop_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def stop_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StopClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.stop_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :stop_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a cluster in a project. + # + # @overload start_cluster(request, options = nil) + # Pass arguments to `start_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::StartClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `start_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new + # + # # Call the start_cluster method. + # result = client.start_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StartClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.start_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.start_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :start_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC should fail + # (with error NOT_FOUND) if cluster with specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :delete_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a cluster in a project. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_cluster(project_id: nil, region: nil, cluster_name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :get_cluster, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all regions/\\{region}/clusters in a project alphabetically. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_clusters(project_id: nil, region: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param filter [::String] + # Optional. A filter constraining the clusters to list. Filters are + # case-sensitive and have the following syntax: + # + # field = value [AND [field = value]] ... + # + # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + # and `[KEY]` is a label key. **value** can be `*` to match all values. + # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` + # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` + # contains the `DELETING` and `ERROR` states. + # `clusterName` is the name of the cluster provided at creation time. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND clusterName = mycluster + # AND labels.env = staging AND labels.starred = * + # @param page_size [::Integer] + # Optional. The standard List page size. + # @param page_token [::String] + # Optional. The standard List page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @cluster_controller_stub, :list_clusters, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets cluster diagnostic information. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # After the operation completes, + # {::Google::Longrunning::Operation#response Operation.response} + # contains + # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + # + # @overload diagnose_cluster(request, options = nil) + # Pass arguments to `diagnose_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) + # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param tarball_gcs_dir [::String] + # Optional. The output Cloud Storage directory for the diagnostic + # tarball. If not specified, a task-specific directory in the cluster's + # staging bucket will be used. + # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket + # @param diagnosis_interval [::Google::Type::Interval, ::Hash] + # Optional. Time interval in which diagnosis should be carried out on the + # cluster. + # @param jobs [::Array<::String>] + # Optional. Specifies a list of jobs on which diagnosis is to be performed. + # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} + # @param yarn_application_ids [::Array<::String>] + # Optional. Specifies a list of yarn applications on which diagnosis is to be + # performed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new + # + # # Call the diagnose_cluster method. + # result = client.diagnose_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def diagnose_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.diagnose_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.cluster_name + header_params["cluster_name"] = request.cluster_name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.diagnose_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.call_rpc :diagnose_cluster, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ClusterController API. + # + # This class represents the configuration for ClusterController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ClusterController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `stop_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_cluster + ## + # RPC-specific configuration for `start_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :start_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `diagnose_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :diagnose_cluster + + # @private + def initialize parent_rpcs = nil + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + stop_cluster_config = parent_rpcs.stop_cluster if parent_rpcs.respond_to? :stop_cluster + @stop_cluster = ::Gapic::Config::Method.new stop_cluster_config + start_cluster_config = parent_rpcs.start_cluster if parent_rpcs.respond_to? :start_cluster + @start_cluster = ::Gapic::Config::Method.new start_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + diagnose_cluster_config = parent_rpcs.diagnose_cluster if parent_rpcs.respond_to? :diagnose_cluster + @diagnose_cluster = ::Gapic::Config::Method.new diagnose_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb new file mode 100644 index 000000000000..cb8ab333e2ed --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + # Credentials for the ClusterController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb new file mode 100644 index 000000000000..bdefb9cfc20a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ClusterController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ClusterController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb new file mode 100644 index 000000000000..e8061ae72751 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + # Path helper methods for the ClusterController API. + module Paths + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified NodeGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` + # + # @param project [String] + # @param region [String] + # @param cluster [String] + # @param node_group [String] + # + # @return [::String] + def node_group_path project:, region:, cluster:, node_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/services/#{service}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb new file mode 100644 index 000000000000..652c94fad760 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/cluster_controller/credentials" +require "google/cloud/dataproc/v1/cluster_controller/paths" +require "google/cloud/dataproc/v1/cluster_controller/rest/operations" +require "google/cloud/dataproc/v1/cluster_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The ClusterControllerService provides methods to manage clusters + # of Compute Engine instances. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/cluster_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + module ClusterController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/cluster_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb new file mode 100644 index 000000000000..24bda580883b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb @@ -0,0 +1,1348 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/clusters_pb" +require "google/cloud/dataproc/v1/cluster_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + module Rest + ## + # REST client for the ClusterController service. + # + # The ClusterControllerService provides methods to manage clusters + # of Compute Engine instances. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :cluster_controller_stub + + ## + # Configure the ClusterController Client class. + # + # See {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ClusterController clients + # ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_cluster.timeout = 300.0 + default_config.rpcs.create_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_cluster.timeout = 300.0 + default_config.rpcs.update_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_cluster.timeout = 300.0 + default_config.rpcs.delete_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 300.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] + } + + default_config.rpcs.list_clusters.timeout = 300.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] + } + + default_config.rpcs.diagnose_cluster.timeout = 300.0 + default_config.rpcs.diagnose_cluster.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ClusterController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @cluster_controller_stub.universe_domain + end + + ## + # Create a new ClusterController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ClusterController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @cluster_controller_stub = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @cluster_controller_stub.endpoint + config.universe_domain = @cluster_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::ClusterController::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil, action_on_failed_primary_workers: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] + # Required. The cluster to create. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param action_on_failed_primary_workers [::Google::Cloud::Dataproc::V1::FailureAction] + # Optional. Failure action when primary worker creation fails. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.create_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # The cluster must be in a + # {::Google::Cloud::Dataproc::V1::ClusterStatus::State `RUNNING`} state or an error + # is returned. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_cluster(project_id: nil, region: nil, cluster_name: nil, cluster: nil, graceful_decommission_timeout: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] + # Required. The changes to the cluster. + # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] + # Optional. Timeout for graceful YARN decommissioning. Graceful + # decommissioning allows removing nodes from the cluster without + # interrupting jobs in progress. Timeout specifies how long to wait for jobs + # in progress to finish before forcefully removing nodes (and potentially + # interrupting jobs). Default timeout is 0 (for forceful decommission), and + # the maximum allowed timeout is 1 day. (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the path, relative to `Cluster`, of + # the field to update. For example, to change the number of workers + # in a cluster to 5, the `update_mask` parameter would be + # specified as `config.worker_config.num_instances`, + # and the `PATCH` request body would specify the new value, as follows: + # + # { + # "config":{ + # "workerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Similarly, to change the number of preemptible workers in a cluster to 5, + # the `update_mask` parameter would be + # `config.secondary_worker_config.num_instances`, and the `PATCH` request + # body would be set as follows: + # + # { + # "config":{ + # "secondaryWorkerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Note: Currently, only the following fields can be updated: + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + # change autoscaling policies
+ # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.update_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Stops a cluster in a project. + # + # @overload stop_cluster(request, options = nil) + # Pass arguments to `stop_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::StopClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `stop_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new + # + # # Call the stop_cluster method. + # result = client.stop_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def stop_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StopClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.stop_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.stop_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a cluster in a project. + # + # @overload start_cluster(request, options = nil) + # Pass arguments to `start_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::StartClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `start_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new + # + # # Call the start_cluster method. + # result = client.start_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def start_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StartClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.start_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.start_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.start_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a cluster in a project. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param cluster_uuid [::String] + # Optional. Specifying the `cluster_uuid` means the RPC should fail + # (with error NOT_FOUND) if cluster with specified UUID does not exist. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.delete_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a cluster in a project. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_cluster(project_id: nil, region: nil, cluster_name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.get_cluster request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists all regions/\\{region}/clusters in a project alphabetically. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_clusters(project_id: nil, region: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param filter [::String] + # Optional. A filter constraining the clusters to list. Filters are + # case-sensitive and have the following syntax: + # + # field = value [AND [field = value]] ... + # + # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + # and `[KEY]` is a label key. **value** can be `*` to match all values. + # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` + # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` + # contains the `DELETING` and `ERROR` states. + # `clusterName` is the name of the cluster provided at creation time. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND clusterName = mycluster + # AND labels.env = staging AND labels.starred = * + # @param page_size [::Integer] + # Optional. The standard List page size. + # @param page_token [::String] + # Optional. The standard List page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListClustersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_clusters.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @cluster_controller_stub, :list_clusters, "clusters", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets cluster diagnostic information. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # After the operation completes, + # {::Google::Longrunning::Operation#response Operation.response} + # contains + # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + # + # @overload diagnose_cluster(request, options = nil) + # Pass arguments to `diagnose_cluster` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) + # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param cluster_name [::String] + # Required. The cluster name. + # @param tarball_gcs_dir [::String] + # Optional. The output Cloud Storage directory for the diagnostic + # tarball. If not specified, a task-specific directory in the cluster's + # staging bucket will be used. + # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket + # @param diagnosis_interval [::Google::Type::Interval, ::Hash] + # Optional. Time interval in which diagnosis should be carried out on the + # cluster. + # @param jobs [::Array<::String>] + # Optional. Specifies a list of jobs on which diagnosis is to be performed. + # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} + # @param yarn_application_ids [::Array<::String>] + # Optional. Specifies a list of yarn applications on which diagnosis is to be + # performed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new + # + # # Call the diagnose_cluster method. + # result = client.diagnose_cluster request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def diagnose_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.diagnose_cluster.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.diagnose_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cluster_controller_stub.diagnose_cluster request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ClusterController REST API. + # + # This class represents the configuration for ClusterController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_cluster.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ClusterController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `stop_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_cluster + ## + # RPC-specific configuration for `start_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :start_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `diagnose_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :diagnose_cluster + + # @private + def initialize parent_rpcs = nil + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + stop_cluster_config = parent_rpcs.stop_cluster if parent_rpcs.respond_to? :stop_cluster + @stop_cluster = ::Gapic::Config::Method.new stop_cluster_config + start_cluster_config = parent_rpcs.start_cluster if parent_rpcs.respond_to? :start_cluster + @start_cluster = ::Gapic::Config::Method.new start_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + diagnose_cluster_config = parent_rpcs.diagnose_cluster if parent_rpcs.respond_to? :diagnose_cluster + @diagnose_cluster = ::Gapic::Config::Method.new diagnose_cluster_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb new file mode 100644 index 000000000000..702d184106b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ClusterController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the ClusterController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb new file mode 100644 index 000000000000..6dc7da911d79 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb @@ -0,0 +1,560 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/clusters_pb" + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + module Rest + ## + # REST service stub for the ClusterController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the stop_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::StopClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def stop_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the start_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::StartClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def start_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Cluster.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the diagnose_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def diagnose_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_diagnose_cluster_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters", + body: "cluster", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + body: "cluster", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::StopClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::StartClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListClustersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the diagnose_cluster REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_diagnose_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["cluster_name", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb new file mode 100644 index 000000000000..723a6669cfa1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/clusters.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/operations_pb' +require 'google/cloud/dataproc/v1/shared_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/protobuf/wrappers_pb' +require 'google/type/interval_pb' + + +descriptor_data = "\n\'google/cloud/dataproc/v1/clusters.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/dataproc/v1/operations.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1agoogle/type/interval.proto\"\xa2\x04\n\x07\x43luster\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x01\x12S\n\x16virtual_cluster_config\x18\n \x01(\x0b\x32..google.cloud.dataproc.v1.VirtualClusterConfigB\x03\xe0\x41\x01\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32-.google.cloud.dataproc.v1.Cluster.LabelsEntryB\x03\xe0\x41\x01\x12<\n\x06status\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x44\n\x0estatus_history\x18\x07 \x03(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x07metrics\x18\t \x01(\x0b\x32(.google.cloud.dataproc.v1.ClusterMetricsB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\t\n\rClusterConfig\x12\x1a\n\rconfig_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0btemp_bucket\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12K\n\x12gce_cluster_config\x18\x08 \x01(\x0b\x32*.google.cloud.dataproc.v1.GceClusterConfigB\x03\xe0\x41\x01\x12I\n\rmaster_config\x18\t \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12I\n\rworker_config\x18\n \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12S\n\x17secondary_worker_config\x18\x0c \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsoftware_config\x18\r \x01(\x0b\x32(.google.cloud.dataproc.v1.SoftwareConfigB\x03\xe0\x41\x01\x12W\n\x16initialization_actions\x18\x0b \x03(\x0b\x32\x32.google.cloud.dataproc.v1.NodeInitializationActionB\x03\xe0\x41\x01\x12J\n\x11\x65ncryption_config\x18\x0f \x01(\x0b\x32*.google.cloud.dataproc.v1.EncryptionConfigB\x03\xe0\x41\x01\x12L\n\x12\x61utoscaling_config\x18\x12 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsecurity_config\x18\x10 \x01(\x0b\x32(.google.cloud.dataproc.v1.SecurityConfigB\x03\xe0\x41\x01\x12H\n\x10lifecycle_config\x18\x11 \x01(\x0b\x32).google.cloud.dataproc.v1.LifecycleConfigB\x03\xe0\x41\x01\x12\x46\n\x0f\x65ndpoint_config\x18\x13 \x01(\x0b\x32(.google.cloud.dataproc.v1.EndpointConfigB\x03\xe0\x41\x01\x12H\n\x10metastore_config\x18\x14 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12S\n\x16\x64\x61taproc_metric_config\x18\x17 \x01(\x0b\x32..google.cloud.dataproc.v1.DataprocMetricConfigB\x03\xe0\x41\x01\x12P\n\x15\x61uxiliary_node_groups\x18\x19 \x03(\x0b\x32,.google.cloud.dataproc.v1.AuxiliaryNodeGroupB\x03\xe0\x41\x01\"\x84\x02\n\x14VirtualClusterConfig\x12\x1b\n\x0estaging_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12[\n\x19kubernetes_cluster_config\x18\x06 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.KubernetesClusterConfigB\x03\xe0\x41\x02H\x00\x12Y\n\x19\x61uxiliary_services_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.AuxiliaryServicesConfigB\x03\xe0\x41\x01\x42\x17\n\x15infrastructure_config\"\xc1\x01\n\x17\x41uxiliaryServicesConfig\x12H\n\x10metastore_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xba\x01\n\x0e\x45ndpointConfig\x12P\n\nhttp_ports\x18\x01 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.EndpointConfig.HttpPortsEntryB\x03\xe0\x41\x03\x12$\n\x17\x65nable_http_port_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x30\n\x0eHttpPortsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\",\n\x11\x41utoscalingConfig\x12\x17\n\npolicy_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\"4\n\x10\x45ncryptionConfig\x12 \n\x13gce_pd_kms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xba\x07\n\x10GceClusterConfig\x12\x15\n\x08zone_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bnetwork_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0esubnetwork_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x10internal_ip_only\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12k\n\x1aprivate_ipv6_google_access\x18\x0c \x01(\x0e\x32\x42.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccessB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12O\n\x08metadata\x18\x05 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.GceClusterConfig.MetadataEntryB\x03\xe0\x41\x01\x12P\n\x14reservation_affinity\x18\x0b \x01(\x0b\x32-.google.cloud.dataproc.v1.ReservationAffinityB\x03\xe0\x41\x01\x12M\n\x13node_group_affinity\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.NodeGroupAffinityB\x03\xe0\x41\x01\x12W\n\x18shielded_instance_config\x18\x0e \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12_\n\x1c\x63onfidential_instance_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.dataproc.v1.ConfidentialInstanceConfigB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x01\n\x17PrivateIpv6GoogleAccess\x12*\n&PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED\x10\x00\x12\x1b\n\x17INHERIT_FROM_SUBNETWORK\x10\x01\x12\x0c\n\x08OUTBOUND\x10\x02\x12\x11\n\rBIDIRECTIONAL\x10\x03\x42\x13\n\x11_internal_ip_only\"0\n\x11NodeGroupAffinity\x12\x1b\n\x0enode_group_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xd3\x01\n\x16ShieldedInstanceConfig\x12$\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12-\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13_enable_secure_bootB\x0e\n\x0c_enable_vtpmB\x1e\n\x1c_enable_integrity_monitoring\"F\n\x1a\x43onfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x06\n\x13InstanceGroupConfig\x12\x1a\n\rnum_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0einstance_names\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12M\n\x13instance_references\x18\x0b \x03(\x0b\x32+.google.cloud.dataproc.v1.InstanceReferenceB\x03\xe0\x41\x03\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10machine_type_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0b\x64isk_config\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.DiskConfigB\x03\xe0\x41\x01\x12\x1b\n\x0eis_preemptible\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x0epreemptibility\x18\n \x01(\x0e\x32<.google.cloud.dataproc.v1.InstanceGroupConfig.PreemptibilityB\x03\xe0\x41\x01\x12O\n\x14managed_group_config\x18\x07 \x01(\x0b\x32,.google.cloud.dataproc.v1.ManagedGroupConfigB\x03\xe0\x41\x03\x12\x46\n\x0c\x61\x63\x63\x65lerators\x18\x08 \x03(\x0b\x32+.google.cloud.dataproc.v1.AcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11min_num_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12]\n\x1binstance_flexibility_policy\x18\r \x01(\x0b\x32\x33.google.cloud.dataproc.v1.InstanceFlexibilityPolicyB\x03\xe0\x41\x01\x12\x44\n\x0estartup_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.StartupConfigB\x03\xe0\x41\x01\"`\n\x0ePreemptibility\x12\x1e\n\x1aPREEMPTIBILITY_UNSPECIFIED\x10\x00\x12\x13\n\x0fNON_PREEMPTIBLE\x10\x01\x12\x0f\n\x0bPREEMPTIBLE\x10\x02\x12\x08\n\x04SPOT\x10\x03\"d\n\rStartupConfig\x12\x30\n\x1erequired_registration_fraction\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42!\n\x1f_required_registration_fraction\"m\n\x11InstanceReference\x12\x15\n\rinstance_name\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x12\n\npublic_key\x18\x03 \x01(\t\x12\x18\n\x10public_ecies_key\x18\x04 \x01(\t\"\x8c\x01\n\x12ManagedGroupConfig\x12#\n\x16instance_template_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12(\n\x1binstance_group_manager_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1ainstance_group_manager_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xb7\x03\n\x19InstanceFlexibilityPolicy\x12k\n\x17instance_selection_list\x18\x02 \x03(\x0b\x32\x45.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionB\x03\xe0\x41\x01\x12t\n\x1ainstance_selection_results\x18\x03 \x03(\x0b\x32K.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResultB\x03\xe0\x41\x03\x1a\x42\n\x11InstanceSelection\x12\x1a\n\rmachine_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04rank\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1as\n\x17InstanceSelectionResult\x12\x1e\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\x08vm_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x0f\n\r_machine_typeB\x0b\n\t_vm_count\"L\n\x11\x41\x63\x63\x65leratorConfig\x12\x1c\n\x14\x61\x63\x63\x65lerator_type_uri\x18\x01 \x01(\t\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x02 \x01(\x05\"\x88\x01\n\nDiskConfig\x12\x1b\n\x0e\x62oot_disk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0enum_local_ssds\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13local_ssd_interface\x18\x04 \x01(\tB\x03\xe0\x41\x01\"n\n\x12\x41uxiliaryNodeGroup\x12<\n\nnode_group\x18\x01 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbd\x03\n\tNodeGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05roles\x18\x02 \x03(\x0e\x32(.google.cloud.dataproc.v1.NodeGroup.RoleB\x03\xe0\x41\x02\x12M\n\x11node_group_config\x18\x03 \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.dataproc.v1.NodeGroup.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"(\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44RIVER\x10\x01:v\xea\x41s\n!dataproc.googleapis.com/NodeGroup\x12Nprojects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}\"s\n\x18NodeInitializationAction\x12\x1c\n\x0f\x65xecutable_file\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x11\x65xecution_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xd6\x03\n\rClusterStatus\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32-.google.cloud.dataproc.v1.ClusterStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x06\x64\x65tail\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08substate\x18\x04 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.ClusterStatus.SubstateB\x03\xe0\x41\x03\"\xa7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x17\n\x13\x45RROR_DUE_TO_UPDATE\x10\t\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0c\n\x08UPDATING\x10\x05\x12\x0c\n\x08STOPPING\x10\x06\x12\x0b\n\x07STOPPED\x10\x07\x12\x0c\n\x08STARTING\x10\x08\x12\r\n\tREPAIRING\x10\n\"<\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tUNHEALTHY\x10\x01\x12\x10\n\x0cSTALE_STATUS\x10\x02\"\xa0\x01\n\x0eSecurityConfig\x12\x46\n\x0fkerberos_config\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.KerberosConfigB\x03\xe0\x41\x01\x12\x46\n\x0fidentity_config\x18\x02 \x01(\x0b\x32(.google.cloud.dataproc.v1.IdentityConfigB\x03\xe0\x41\x01\"\x90\x04\n\x0eKerberosConfig\x12\x1c\n\x0f\x65nable_kerberos\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1broot_principal_password_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bkms_key_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0ckeystore_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0etruststore_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15keystore_password_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10key_password_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17truststore_password_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x63ross_realm_trust_realm\x18\t \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15\x63ross_realm_trust_kdc\x18\n \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x63ross_realm_trust_admin_server\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12\x32\n%cross_realm_trust_shared_password_uri\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ekdc_db_key_uri\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12tgt_lifetime_hours\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05realm\x18\x0f \x01(\tB\x03\xe0\x41\x01\"\xc6\x01\n\x0eIdentityConfig\x12r\n\x1cuser_service_account_mapping\x18\x01 \x03(\x0b\x32G.google.cloud.dataproc.v1.IdentityConfig.UserServiceAccountMappingEntryB\x03\xe0\x41\x02\x1a@\n\x1eUserServiceAccountMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf9\x01\n\x0eSoftwareConfig\x12\x1a\n\rimage_version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.SoftwareConfig.PropertiesEntryB\x03\xe0\x41\x01\x12\x45\n\x13optional_components\x18\x03 \x03(\x0e\x32#.google.cloud.dataproc.v1.ComponentB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x02\n\x0fLifecycleConfig\x12\x37\n\x0fidle_delete_ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12;\n\x10\x61uto_delete_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12\x39\n\x0f\x61uto_delete_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x38\n\x0fidle_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x05\n\x03ttl\"_\n\x0fMetastoreConfig\x12L\n\x1a\x64\x61taproc_metastore_service\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n metastore.googleapis.com/Service\"\x9a\x02\n\x0e\x43lusterMetrics\x12O\n\x0chdfs_metrics\x18\x01 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.HdfsMetricsEntry\x12O\n\x0cyarn_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.YarnMetricsEntry\x1a\x32\n\x10HdfsMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10YarnMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\x92\x03\n\x14\x44\x61taprocMetricConfig\x12K\n\x07metrics\x18\x01 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.DataprocMetricConfig.MetricB\x03\xe0\x41\x02\x1a\x80\x01\n\x06Metric\x12W\n\rmetric_source\x18\x01 \x01(\x0e\x32;.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSourceB\x03\xe0\x41\x02\x12\x1d\n\x10metric_overrides\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xa9\x01\n\x0cMetricSource\x12\x1d\n\x19METRIC_SOURCE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MONITORING_AGENT_DEFAULTS\x10\x01\x12\x08\n\x04HDFS\x10\x02\x12\t\n\x05SPARK\x10\x03\x12\x08\n\x04YARN\x10\x04\x12\x18\n\x14SPARK_HISTORY_SERVER\x10\x05\x12\x0f\n\x0bHIVESERVER2\x10\x06\x12\x11\n\rHIVEMETASTORE\x10\x07\"\xee\x01\n\x14\x43reateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12V\n action_on_failed_primary_workers\x18\x05 \x01(\x0e\x32\'.google.cloud.dataproc.v1.FailureActionB\x03\xe0\x41\x01\"\xae\x02\n\x14UpdateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x45\n\x1dgraceful_decommission_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x12StopClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x92\x01\n\x13StartClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x14\x44\x65leteClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\\\n\x11GetClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x89\x01\n\x13ListClustersRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"n\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xb3\x03\n\x16\x44iagnoseClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarball_gcs_dir\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0etarball_access\x18\x05 \x01(\x0e\x32>.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccessB\x03\xe0\x41\x01\x12\x36\n\x12\x64iagnosis_interval\x18\x06 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x01\x12\x11\n\x04jobs\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14yarn_application_ids\x18\x0b \x03(\tB\x03\xe0\x41\x01\"g\n\rTarballAccess\x12\x1e\n\x1aTARBALL_ACCESS_UNSPECIFIED\x10\x00\x12\x18\n\x14GOOGLE_CLOUD_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_DATAPROC_DIAGNOSE\x10\x02\"1\n\x16\x44iagnoseClusterResults\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xf8\x01\n\x13ReservationAffinity\x12Y\n\x18\x63onsume_reservation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dataproc.v1.ReservationAffinity.TypeB\x03\xe0\x41\x01\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x32\xe4\x10\n\x11\x43lusterController\x12\x80\x02\n\rCreateCluster\x12..google.cloud.dataproc.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x19project_id,region,cluster\x82\xd3\xe4\x93\x02>\"3/v1/projects/{project_id}/regions/{region}/clusters:\x07\x63luster\x12\xa8\x02\n\rUpdateCluster\x12..google.cloud.dataproc.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x32project_id,region,cluster_name,cluster,update_mask\x82\xd3\xe4\x93\x02M2B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:\x07\x63luster\x12\xee\x01\n\x0bStopCluster\x12,.google.cloud.dataproc.v1.StopClusterRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02L\"G/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop:\x01*\x12\xf1\x01\n\x0cStartCluster\x12-.google.cloud.dataproc.v1.StartClusterRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02M\"H/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start:\x01*\x12\x99\x02\n\rDeleteCluster\x12..google.cloud.dataproc.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44*B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xc9\x01\n\nGetCluster\x12+.google.cloud.dataproc.v1.GetClusterRequest\x1a!.google.cloud.dataproc.v1.Cluster\"k\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xd9\x01\n\x0cListClusters\x12-.google.cloud.dataproc.v1.ListClustersRequest\x1a..google.cloud.dataproc.v1.ListClustersResponse\"j\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/projects/{project_id}/regions/{region}/clusters\x12\xaa\x02\n\x0f\x44iagnoseCluster\x12\x30.google.cloud.dataproc.v1.DiagnoseClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41K\n\x16\x44iagnoseClusterResults\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02P\"K/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose:\x01*\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rClustersProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dataproc.v1.KubernetesClusterConfig", "google/cloud/dataproc/v1/shared.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.type.Interval", "google/type/interval.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Cluster").msgclass + ClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterConfig").msgclass + VirtualClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.VirtualClusterConfig").msgclass + AuxiliaryServicesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AuxiliaryServicesConfig").msgclass + EndpointConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EndpointConfig").msgclass + AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutoscalingConfig").msgclass + EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EncryptionConfig").msgclass + GceClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GceClusterConfig").msgclass + GceClusterConfig::PrivateIpv6GoogleAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess").enummodule + NodeGroupAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupAffinity").msgclass + ShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ShieldedInstanceConfig").msgclass + ConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ConfidentialInstanceConfig").msgclass + InstanceGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceGroupConfig").msgclass + InstanceGroupConfig::Preemptibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility").enummodule + StartupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StartupConfig").msgclass + InstanceReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceReference").msgclass + ManagedGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ManagedGroupConfig").msgclass + InstanceFlexibilityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy").msgclass + InstanceFlexibilityPolicy::InstanceSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection").msgclass + InstanceFlexibilityPolicy::InstanceSelectionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult").msgclass + AcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AcceleratorConfig").msgclass + DiskConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiskConfig").msgclass + AuxiliaryNodeGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AuxiliaryNodeGroup").msgclass + NodeGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroup").msgclass + NodeGroup::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroup.Role").enummodule + NodeInitializationAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeInitializationAction").msgclass + ClusterStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus").msgclass + ClusterStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus.State").enummodule + ClusterStatus::Substate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus.Substate").enummodule + SecurityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SecurityConfig").msgclass + KerberosConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KerberosConfig").msgclass + IdentityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.IdentityConfig").msgclass + SoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SoftwareConfig").msgclass + LifecycleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LifecycleConfig").msgclass + MetastoreConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.MetastoreConfig").msgclass + ClusterMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterMetrics").msgclass + DataprocMetricConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig").msgclass + DataprocMetricConfig::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.Metric").msgclass + DataprocMetricConfig::MetricSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource").enummodule + CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateClusterRequest").msgclass + UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateClusterRequest").msgclass + StopClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StopClusterRequest").msgclass + StartClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StartClusterRequest").msgclass + DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteClusterRequest").msgclass + GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetClusterRequest").msgclass + ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersRequest").msgclass + ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersResponse").msgclass + DiagnoseClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest").msgclass + DiagnoseClusterRequest::TarballAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess").enummodule + DiagnoseClusterResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterResults").msgclass + ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity").msgclass + ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb new file mode 100644 index 000000000000..36ce47da9e47 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/clusters.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/clusters_pb' + +module Google + module Cloud + module Dataproc + module V1 + module ClusterController + # The ClusterControllerService provides methods to manage clusters + # of Compute Engine instances. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.ClusterController' + + # Creates a cluster in a project. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + rpc :CreateCluster, ::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Google::Longrunning::Operation + # Updates a cluster in a project. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # The cluster must be in a + # [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error + # is returned. + rpc :UpdateCluster, ::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Google::Longrunning::Operation + # Stops a cluster in a project. + rpc :StopCluster, ::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Google::Longrunning::Operation + # Starts a cluster in a project. + rpc :StartCluster, ::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Google::Longrunning::Operation + # Deletes a cluster in a project. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + rpc :DeleteCluster, ::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Google::Longrunning::Operation + # Gets the resource representation for a cluster in a project. + rpc :GetCluster, ::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Google::Cloud::Dataproc::V1::Cluster + # Lists all regions/{region}/clusters in a project alphabetically. + rpc :ListClusters, ::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Google::Cloud::Dataproc::V1::ListClustersResponse + # Gets cluster diagnostic information. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] will be + # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + # After the operation completes, + # [Operation.response][google.longrunning.Operation.response] + # contains + # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + rpc :DiagnoseCluster, ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb new file mode 100644 index 000000000000..65b0d56ce51c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/job_controller/credentials" +require "google/cloud/dataproc/v1/job_controller/operations" +require "google/cloud/dataproc/v1/job_controller/client" +require "google/cloud/dataproc/v1/job_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The JobController provides methods to manage jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/job_controller" + # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/job_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + module JobController + end + end + end + end +end + +helper_path = ::File.join __dir__, "job_controller", "helpers.rb" +require "google/cloud/dataproc/v1/job_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb new file mode 100644 index 000000000000..66606eeeb67d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb @@ -0,0 +1,1192 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/jobs_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + ## + # Client for the JobController service. + # + # The JobController provides methods to manage jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :job_controller_stub + + ## + # Configure the JobController Client class. + # + # See {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobController clients + # ::Google::Cloud::Dataproc::V1::JobController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.submit_job.timeout = 900.0 + default_config.rpcs.submit_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.submit_job_as_operation.timeout = 900.0 + default_config.rpcs.submit_job_as_operation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_job.timeout = 900.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.list_jobs.timeout = 900.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.update_job.timeout = 900.0 + default_config.rpcs.update_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.cancel_job.timeout = 900.0 + default_config.rpcs.cancel_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.delete_job.timeout = 900.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_controller_stub.universe_domain + end + + ## + # Create a new JobController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/jobs_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @job_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::JobController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @job_controller_stub.endpoint + config.universe_domain = @job_controller_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::JobController::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Submits a job to a cluster. + # + # @overload submit_job(request, options = nil) + # Pass arguments to `submit_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload submit_job(project_id: nil, region: nil, job: nil, request_id: nil) + # Pass arguments to `submit_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The job resource. + # @param request_id [::String] + # Optional. A unique id used to identify the request. If the server + # receives two + # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job method. + # result = client.submit_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def submit_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.submit_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.submit_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.submit_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :submit_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Submits job to a cluster. + # + # @overload submit_job_as_operation(request, options = nil) + # Pass arguments to `submit_job_as_operation` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload submit_job_as_operation(project_id: nil, region: nil, job: nil, request_id: nil) + # Pass arguments to `submit_job_as_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The job resource. + # @param request_id [::String] + # Optional. A unique id used to identify the request. If the server + # receives two + # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job_as_operation method. + # result = client.submit_job_as_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def submit_job_as_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.submit_job_as_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.submit_job_as_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :submit_job_as_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a job in a project. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.job_id + header_params["job_id"] = request.job_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists regions/\\{region}/jobs in a project. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(project_id: nil, region: nil, page_size: nil, page_token: nil, cluster_name: nil, job_state_matcher: nil, filter: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param page_size [::Integer] + # Optional. The number of results to return in each response. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # @param cluster_name [::String] + # Optional. If set, the returned jobs list includes only jobs that were + # submitted to the named cluster. + # @param job_state_matcher [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] + # Optional. Specifies enumerated categories of jobs to list. + # (default = match ALL jobs). + # + # If `filter` is provided, `jobStateMatcher` will be ignored. + # @param filter [::String] + # Optional. A filter constraining the jobs to list. Filters are + # case-sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + # + # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + # key. **value** can be `*` to match all values. + # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND labels.env = staging AND labels.starred = * + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @job_controller_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a job in a project. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_job(project_id: nil, region: nil, job_id: nil, job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The changes to the job. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the path, relative to Job, of + # the field to update. For example, to update the labels of a Job the + # update_mask parameter would be specified as + # labels, and the `PATCH` request body would specify the new + # value. Note: Currently, labels is the only + # field that can be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.job_id + header_params["job_id"] = request.job_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :update_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a job cancellation request. To access the job resource + # after cancellation, call + # [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) + # or + # [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). + # + # @overload cancel_job(request, options = nil) + # Pass arguments to `cancel_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CancelJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `cancel_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def cancel_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CancelJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.job_id + header_params["job_id"] = request.job_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :cancel_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the job from the project. If the job is active, the delete fails, + # and the response returns `FAILED_PRECONDITION`. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.project_id + header_params["project_id"] = request.project_id + end + if request.region + header_params["region"] = request.region + end + if request.job_id + header_params["job_id"] = request.job_id + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.call_rpc :delete_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobController API. + # + # This class represents the configuration for JobController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # submit_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::JobController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.submit_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.submit_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the JobController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `submit_job` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_job + ## + # RPC-specific configuration for `submit_job_as_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_job_as_operation + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `cancel_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + + # @private + def initialize parent_rpcs = nil + submit_job_config = parent_rpcs.submit_job if parent_rpcs.respond_to? :submit_job + @submit_job = ::Gapic::Config::Method.new submit_job_config + submit_job_as_operation_config = parent_rpcs.submit_job_as_operation if parent_rpcs.respond_to? :submit_job_as_operation + @submit_job_as_operation = ::Gapic::Config::Method.new submit_job_as_operation_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job + @cancel_job = ::Gapic::Config::Method.new cancel_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb new file mode 100644 index 000000000000..ac4f12b250f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + # Credentials for the JobController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb new file mode 100644 index 000000000000..ba74df48decd --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the JobController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb new file mode 100644 index 000000000000..c0f777614652 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/job_controller/credentials" +require "google/cloud/dataproc/v1/job_controller/rest/operations" +require "google/cloud/dataproc/v1/job_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The JobController provides methods to manage jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/job_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + module JobController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/job_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb new file mode 100644 index 000000000000..a29db22313ca --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb @@ -0,0 +1,1092 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/jobs_pb" +require "google/cloud/dataproc/v1/job_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + module Rest + ## + # REST client for the JobController service. + # + # The JobController provides methods to manage jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :job_controller_stub + + ## + # Configure the JobController Client class. + # + # See {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all JobController clients + # ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.submit_job.timeout = 900.0 + default_config.rpcs.submit_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.submit_job_as_operation.timeout = 900.0 + default_config.rpcs.submit_job_as_operation.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_job.timeout = 900.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.list_jobs.timeout = 900.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.update_job.timeout = 900.0 + default_config.rpcs.update_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.cancel_job.timeout = 900.0 + default_config.rpcs.cancel_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.delete_job.timeout = 900.0 + default_config.rpcs.delete_job.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the JobController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @job_controller_stub.universe_domain + end + + ## + # Create a new JobController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the JobController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @job_controller_stub = ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @job_controller_stub.endpoint + config.universe_domain = @job_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::JobController::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Submits a job to a cluster. + # + # @overload submit_job(request, options = nil) + # Pass arguments to `submit_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload submit_job(project_id: nil, region: nil, job: nil, request_id: nil) + # Pass arguments to `submit_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The job resource. + # @param request_id [::String] + # Optional. A unique id used to identify the request. If the server + # receives two + # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job method. + # result = client.submit_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def submit_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.submit_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.submit_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.submit_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.submit_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Submits job to a cluster. + # + # @overload submit_job_as_operation(request, options = nil) + # Pass arguments to `submit_job_as_operation` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload submit_job_as_operation(project_id: nil, region: nil, job: nil, request_id: nil) + # Pass arguments to `submit_job_as_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The job resource. + # @param request_id [::String] + # Optional. A unique id used to identify the request. If the server + # receives two + # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # + # # Call the submit_job_as_operation method. + # result = client.submit_job_as_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def submit_job_as_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.submit_job_as_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.submit_job_as_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.submit_job_as_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a job in a project. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists regions/\\{region}/jobs in a project. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(project_id: nil, region: nil, page_size: nil, page_token: nil, cluster_name: nil, job_state_matcher: nil, filter: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param page_size [::Integer] + # Optional. The number of results to return in each response. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # @param cluster_name [::String] + # Optional. If set, the returned jobs list includes only jobs that were + # submitted to the named cluster. + # @param job_state_matcher [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] + # Optional. Specifies enumerated categories of jobs to list. + # (default = match ALL jobs). + # + # If `filter` is provided, `jobStateMatcher` will be ignored. + # @param filter [::String] + # Optional. A filter constraining the jobs to list. Filters are + # case-sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + # + # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + # key. **value** can be `*` to match all values. + # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND labels.env = staging AND labels.starred = * + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.list_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @job_controller_stub, :list_jobs, "jobs", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a job in a project. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_job(project_id: nil, region: nil, job_id: nil, job: nil, update_mask: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] + # Required. The changes to the job. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the path, relative to Job, of + # the field to update. For example, to update the labels of a Job the + # update_mask parameter would be specified as + # labels, and the `PATCH` request body would specify the new + # value. Note: Currently, labels is the only + # field that can be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.update_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts a job cancellation request. To access the job resource + # after cancellation, call + # [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) + # or + # [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). + # + # @overload cancel_job(request, options = nil) + # Pass arguments to `cancel_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CancelJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `cancel_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + # + # # Call the cancel_job method. + # result = client.cancel_job request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Job. + # p result + # + def cancel_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CancelJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.cancel_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the job from the project. If the job is active, the delete fails, + # and the response returns `FAILED_PRECONDITION`. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(project_id: nil, region: nil, job_id: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param project_id [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @param region [::String] + # Required. The Dataproc region in which to handle the request. + # @param job_id [::String] + # Required. The job ID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @job_controller_stub.delete_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the JobController REST API. + # + # This class represents the configuration for JobController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # submit_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.submit_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.submit_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the JobController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `submit_job` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_job + ## + # RPC-specific configuration for `submit_job_as_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_job_as_operation + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `cancel_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + + # @private + def initialize parent_rpcs = nil + submit_job_config = parent_rpcs.submit_job if parent_rpcs.respond_to? :submit_job + @submit_job = ::Gapic::Config::Method.new submit_job_config + submit_job_as_operation_config = parent_rpcs.submit_job_as_operation if parent_rpcs.respond_to? :submit_job_as_operation + @submit_job_as_operation = ::Gapic::Config::Method.new submit_job_as_operation_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job + @cancel_job = ::Gapic::Config::Method.new cancel_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb new file mode 100644 index 000000000000..6af03e02c266 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the JobController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the JobController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb new file mode 100644 index 000000000000..42f3eed81aec --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb @@ -0,0 +1,497 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/jobs_pb" + +module Google + module Cloud + module Dataproc + module V1 + module JobController + module Rest + ## + # REST service stub for the JobController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the submit_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # A result object deserialized from the server's reply + def submit_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_submit_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the submit_job_as_operation REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def submit_job_as_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_submit_job_as_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # A result object deserialized from the server's reply + def update_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CancelJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Job] + # A result object deserialized from the server's reply + def cancel_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the submit_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_submit_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs:submit", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the submit_job_as_operation REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_submit_job_as_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["job_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + body: "job", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["job_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CancelJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", + body: "*", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["job_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + matches: [ + ["project_id", %r{^[^/]+/?$}, false], + ["region", %r{^[^/]+/?$}, false], + ["job_id", %r{^[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb new file mode 100644 index 000000000000..29e3bde715b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/jobs.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n#google/cloud/dataproc/v1/jobs.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x02\n\rLoggingConfig\x12W\n\x11\x64river_log_levels\x18\x02 \x03(\x0b\x32<.google.cloud.dataproc.v1.LoggingConfig.DriverLogLevelsEntry\x1a\x65\n\x14\x44riverLogLevelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0e\x32-.google.cloud.dataproc.v1.LoggingConfig.Level:\x02\x38\x01\"p\n\x05Level\x12\x15\n\x11LEVEL_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41LL\x10\x01\x12\t\n\x05TRACE\x10\x02\x12\t\n\x05\x44\x45\x42UG\x10\x03\x12\x08\n\x04INFO\x10\x04\x12\x08\n\x04WARN\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\t\n\x05\x46\x41TAL\x10\x07\x12\x07\n\x03OFF\x10\x08\"\xf1\x02\n\tHadoopJob\x12\x1b\n\x11main_jar_file_uri\x18\x01 \x01(\tH\x00\x12\x14\n\nmain_class\x18\x02 \x01(\tH\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x07 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.HadoopJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x64river\"\xef\x02\n\x08SparkJob\x12\x1b\n\x11main_jar_file_uri\x18\x01 \x01(\tH\x00\x12\x14\n\nmain_class\x18\x02 \x01(\tH\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12K\n\nproperties\x18\x07 \x03(\x0b\x32\x32.google.cloud.dataproc.v1.SparkJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x64river\"\xf8\x02\n\nPySparkJob\x12!\n\x14main_python_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10python_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12M\n\nproperties\x18\x07 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.PySparkJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"!\n\tQueryList\x12\x14\n\x07queries\x18\x01 \x03(\tB\x03\xe0\x41\x02\"\xb5\x03\n\x07HiveJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12U\n\x10script_variables\x18\x04 \x03(\x0b\x32\x36.google.cloud.dataproc.v1.HiveJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12J\n\nproperties\x18\x05 \x03(\x0b\x32\x31.google.cloud.dataproc.v1.HiveJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xe5\x03\n\x0bSparkSqlJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12Y\n\x10script_variables\x18\x03 \x03(\x0b\x32:.google.cloud.dataproc.v1.SparkSqlJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12N\n\nproperties\x18\x04 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.SparkSqlJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x38 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x06 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xf8\x03\n\x06PigJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12T\n\x10script_variables\x18\x04 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.PigJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12I\n\nproperties\x18\x05 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.PigJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xb6\x02\n\tSparkRJob\x12\x1c\n\x0fmain_r_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x05 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.SparkRJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x06 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8a\x03\n\tPrestoJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\routput_format\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63lient_tags\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x06 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.PrestoJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\x88\x03\n\x08TrinoJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\routput_format\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63lient_tags\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12K\n\nproperties\x18\x06 \x03(\x0b\x32\x32.google.cloud.dataproc.v1.TrinoJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xd2\x01\n\x0cJobPlacement\x12\x19\n\x0c\x63luster_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12V\n\x0e\x63luster_labels\x18\x03 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.JobPlacement.ClusterLabelsEntryB\x03\xe0\x41\x01\x1a\x34\n\x12\x43lusterLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd9\x03\n\tJobStatus\x12=\n\x05state\x18\x01 \x01(\x0e\x32).google.cloud.dataproc.v1.JobStatus.StateB\x03\xe0\x41\x03\x12\x17\n\x07\x64\x65tails\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x08substate\x18\x07 \x01(\x0e\x32,.google.cloud.dataproc.v1.JobStatus.SubstateB\x03\xe0\x41\x03\"\xa9\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nSETUP_DONE\x10\x08\x12\x0b\n\x07RUNNING\x10\x02\x12\x12\n\x0e\x43\x41NCEL_PENDING\x10\x03\x12\x12\n\x0e\x43\x41NCEL_STARTED\x10\x07\x12\r\n\tCANCELLED\x10\x04\x12\x08\n\x04\x44ONE\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\x13\n\x0f\x41TTEMPT_FAILURE\x10\t\"H\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tSUBMITTED\x10\x01\x12\n\n\x06QUEUED\x10\x02\x12\x10\n\x0cSTALE_STATUS\x10\x03\"<\n\x0cJobReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa5\x02\n\x0fYarnApplication\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x05state\x18\x02 \x01(\x0e\x32/.google.cloud.dataproc.v1.YarnApplication.StateB\x03\xe0\x41\x02\x12\x15\n\x08progress\x18\x03 \x01(\x02\x42\x03\xe0\x41\x02\x12\x19\n\x0ctracking_url\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x0e\n\nNEW_SAVING\x10\x02\x12\r\n\tSUBMITTED\x10\x03\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x04\x12\x0b\n\x07RUNNING\x10\x05\x12\x0c\n\x08\x46INISHED\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\n\n\x06KILLED\x10\x08\"\x96\n\n\x03Job\x12>\n\treference\x18\x01 \x01(\x0b\x32&.google.cloud.dataproc.v1.JobReferenceB\x03\xe0\x41\x01\x12>\n\tplacement\x18\x02 \x01(\x0b\x32&.google.cloud.dataproc.v1.JobPlacementB\x03\xe0\x41\x02\x12>\n\nhadoop_job\x18\x03 \x01(\x0b\x32#.google.cloud.dataproc.v1.HadoopJobB\x03\xe0\x41\x01H\x00\x12<\n\tspark_job\x18\x04 \x01(\x0b\x32\".google.cloud.dataproc.v1.SparkJobB\x03\xe0\x41\x01H\x00\x12@\n\x0bpyspark_job\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.PySparkJobB\x03\xe0\x41\x01H\x00\x12:\n\x08hive_job\x18\x06 \x01(\x0b\x32!.google.cloud.dataproc.v1.HiveJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x07pig_job\x18\x07 \x01(\x0b\x32 .google.cloud.dataproc.v1.PigJobB\x03\xe0\x41\x01H\x00\x12?\n\x0bspark_r_job\x18\x15 \x01(\x0b\x32#.google.cloud.dataproc.v1.SparkRJobB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_sql_job\x18\x0c \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkSqlJobB\x03\xe0\x41\x01H\x00\x12>\n\npresto_job\x18\x17 \x01(\x0b\x32#.google.cloud.dataproc.v1.PrestoJobB\x03\xe0\x41\x01H\x00\x12<\n\ttrino_job\x18\x1c \x01(\x0b\x32\".google.cloud.dataproc.v1.TrinoJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x06status\x18\x08 \x01(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12@\n\x0estatus_history\x18\r \x03(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12I\n\x11yarn_applications\x18\t \x03(\x0b\x32).google.cloud.dataproc.v1.YarnApplicationB\x03\xe0\x41\x03\x12\'\n\x1a\x64river_output_resource_uri\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12%\n\x18\x64river_control_files_uri\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x12 \x03(\x0b\x32).google.cloud.dataproc.v1.Job.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nscheduling\x18\x14 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JobSchedulingB\x03\xe0\x41\x01\x12\x15\n\x08job_uuid\x18\x16 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x64one\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12W\n\x18\x64river_scheduling_config\x18\x1b \x01(\x0b\x32\x30.google.cloud.dataproc.v1.DriverSchedulingConfigB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08type_job\"E\n\x16\x44riverSchedulingConfig\x12\x16\n\tmemory_mb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x13\n\x06vcores\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\"T\n\rJobScheduling\x12\"\n\x15max_failures_per_hour\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12max_failures_total\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8a\x01\n\x10SubmitJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12/\n\x03job\x18\x02 \x01(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x0bJobMetadata\x12\x13\n\x06job_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x38\n\x06status\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12\x1b\n\x0eoperation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"R\n\rGetJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xb3\x02\n\x0fListJobsRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x63luster_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x11job_state_matcher\x18\x05 \x01(\x0e\x32\x39.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcherB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x07 \x01(\tB\x03\xe0\x41\x01\"6\n\x0fJobStateMatcher\x12\x07\n\x03\x41LL\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nNON_ACTIVE\x10\x02\"\xbc\x01\n\x10UpdateJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12/\n\x03job\x18\x04 \x01(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"b\n\x10ListJobsResponse\x12\x30\n\x04jobs\x18\x01 \x03(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"U\n\x10\x43\x61ncelJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"U\n\x10\x44\x65leteJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x32\xfc\n\n\rJobController\x12\xb1\x01\n\tSubmitJob\x12*.google.cloud.dataproc.v1.SubmitJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"Y\xda\x41\x15project_id,region,job\x82\xd3\xe4\x93\x02;\"6/v1/projects/{project_id}/regions/{region}/jobs:submit:\x01*\x12\xde\x01\n\x14SubmitJobAsOperation\x12*.google.cloud.dataproc.v1.SubmitJobRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x12\n\x03Job\x12\x0bJobMetadata\xda\x41\x17project_id, region, job\x82\xd3\xe4\x93\x02\x46\"A/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation:\x01*\x12\xad\x01\n\x06GetJob\x12\'.google.cloud.dataproc.v1.GetJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"[\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02:\x12\x38/v1/projects/{project_id}/regions/{region}/jobs/{job_id}\x12\xc9\x01\n\x08ListJobs\x12).google.cloud.dataproc.v1.ListJobsRequest\x1a*.google.cloud.dataproc.v1.ListJobsResponse\"f\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x31\x12//v1/projects/{project_id}/regions/{region}/jobs\x12\x9d\x01\n\tUpdateJob\x12*.google.cloud.dataproc.v1.UpdateJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"E\x82\xd3\xe4\x93\x02?28/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:\x03job\x12\xbd\x01\n\tCancelJob\x12*.google.cloud.dataproc.v1.CancelJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"e\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02\x44\"?/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel:\x01*\x12\xac\x01\n\tDeleteJob\x12*.google.cloud.dataproc.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02:*8/v1/projects/{project_id}/regions/{region}/jobs/{job_id}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x1c\x63om.google.cloud.dataproc.v1B\tJobsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LoggingConfig").msgclass + LoggingConfig::Level = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LoggingConfig.Level").enummodule + HadoopJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.HadoopJob").msgclass + SparkJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkJob").msgclass + PySparkJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PySparkJob").msgclass + QueryList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.QueryList").msgclass + HiveJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.HiveJob").msgclass + SparkSqlJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkSqlJob").msgclass + PigJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PigJob").msgclass + SparkRJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkRJob").msgclass + PrestoJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PrestoJob").msgclass + TrinoJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.TrinoJob").msgclass + JobPlacement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobPlacement").msgclass + JobStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus").msgclass + JobStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus.State").enummodule + JobStatus::Substate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus.Substate").enummodule + JobReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobReference").msgclass + YarnApplication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.YarnApplication").msgclass + YarnApplication::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.YarnApplication.State").enummodule + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Job").msgclass + DriverSchedulingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DriverSchedulingConfig").msgclass + JobScheduling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobScheduling").msgclass + SubmitJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SubmitJobRequest").msgclass + JobMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobMetadata").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetJobRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsRequest").msgclass + ListJobsRequest::JobStateMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher").enummodule + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateJobRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsResponse").msgclass + CancelJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CancelJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteJobRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb new file mode 100644 index 000000000000..135eef3d215d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb @@ -0,0 +1,62 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/jobs.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/jobs_pb' + +module Google + module Cloud + module Dataproc + module V1 + module JobController + # The JobController provides methods to manage jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.JobController' + + # Submits a job to a cluster. + rpc :SubmitJob, ::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Google::Cloud::Dataproc::V1::Job + # Submits job to a cluster. + rpc :SubmitJobAsOperation, ::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Google::Longrunning::Operation + # Gets the resource representation for a job in a project. + rpc :GetJob, ::Google::Cloud::Dataproc::V1::GetJobRequest, ::Google::Cloud::Dataproc::V1::Job + # Lists regions/{region}/jobs in a project. + rpc :ListJobs, ::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Google::Cloud::Dataproc::V1::ListJobsResponse + # Updates a job in a project. + rpc :UpdateJob, ::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Google::Cloud::Dataproc::V1::Job + # Starts a job cancellation request. To access the job resource + # after cancellation, call + # [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) + # or + # [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). + rpc :CancelJob, ::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Google::Cloud::Dataproc::V1::Job + # Deletes the job from the project. If the job is active, the delete fails, + # and the response returns `FAILED_PRECONDITION`. + rpc :DeleteJob, ::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb new file mode 100644 index 000000000000..fee7963fff6b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/node_group_controller/credentials" +require "google/cloud/dataproc/v1/node_group_controller/paths" +require "google/cloud/dataproc/v1/node_group_controller/operations" +require "google/cloud/dataproc/v1/node_group_controller/client" +require "google/cloud/dataproc/v1/node_group_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The `NodeGroupControllerService` provides methods to manage node groups + # of Compute Engine managed instances. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/node_group_controller" + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/node_group_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + module NodeGroupController + end + end + end + end +end + +helper_path = ::File.join __dir__, "node_group_controller", "helpers.rb" +require "google/cloud/dataproc/v1/node_group_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb new file mode 100644 index 000000000000..a200b454d2d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb @@ -0,0 +1,718 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/node_groups_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + ## + # Client for the NodeGroupController service. + # + # The `NodeGroupControllerService` provides methods to manage node groups + # of Compute Engine managed instances. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :node_group_controller_stub + + ## + # Configure the NodeGroupController Client class. + # + # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NodeGroupController clients + # ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the NodeGroupController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @node_group_controller_stub.universe_domain + end + + ## + # Create a new NodeGroupController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NodeGroupController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/node_groups_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @node_group_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::NodeGroupController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @node_group_controller_stub.endpoint + config.universe_domain = @node_group_controller_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::NodeGroupController::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a node group in a cluster. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + # + # @overload create_node_group(request, options = nil) + # Pass arguments to `create_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_node_group(parent: nil, node_group: nil, node_group_id: nil, request_id: nil) + # Pass arguments to `create_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this node group will be created. + # Format: `projects/{project}/regions/{region}/clusters/{cluster}` + # @param node_group [::Google::Cloud::Dataproc::V1::NodeGroup, ::Hash] + # Required. The node group to create. + # @param node_group_id [::String] + # Optional. An optional node group ID. Generated if not specified. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of from 3 to 33 characters. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new + # + # # Call the create_node_group method. + # result = client.create_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_node_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.call_rpc :create_node_group, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resizes a node group in a cluster. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + # + # @overload resize_node_group(request, options = nil) + # Pass arguments to `resize_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resize_node_group(name: nil, size: nil, request_id: nil, graceful_decommission_timeout: nil) + # Pass arguments to `resize_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the node group to resize. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + # @param size [::Integer] + # Required. The number of running instances for the node group to maintain. + # The group adds or removes instances to maintain the number of instances + # specified by this parameter. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] + # Optional. Timeout for graceful YARN decommissioning. [Graceful + # decommissioning] + # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + # allows the removal of nodes from the Compute Engine node group + # without interrupting jobs in progress. This timeout specifies how long to + # wait for jobs in progress to finish before forcefully removing nodes (and + # potentially interrupting jobs). Default timeout is 0 (for forceful + # decommission), and the maximum allowed timeout is 1 day. (see JSON + # representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new + # + # # Call the resize_node_group method. + # result = client.resize_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def resize_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.resize_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resize_node_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resize_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.call_rpc :resize_node_group, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a node group in a + # cluster. + # + # @overload get_node_group(request, options = nil) + # Pass arguments to `get_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_node_group(name: nil) + # Pass arguments to `get_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the node group to retrieve. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::NodeGroup] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::NodeGroup] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new + # + # # Call the get_node_group method. + # result = client.get_node_group request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. + # p result + # + def get_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_node_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.call_rpc :get_node_group, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the NodeGroupController API. + # + # This class represents the configuration for NodeGroupController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_node_group to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_node_group.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_node_group.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the NodeGroupController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_node_group + ## + # RPC-specific configuration for `resize_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :resize_node_group + ## + # RPC-specific configuration for `get_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node_group + + # @private + def initialize parent_rpcs = nil + create_node_group_config = parent_rpcs.create_node_group if parent_rpcs.respond_to? :create_node_group + @create_node_group = ::Gapic::Config::Method.new create_node_group_config + resize_node_group_config = parent_rpcs.resize_node_group if parent_rpcs.respond_to? :resize_node_group + @resize_node_group = ::Gapic::Config::Method.new resize_node_group_config + get_node_group_config = parent_rpcs.get_node_group if parent_rpcs.respond_to? :get_node_group + @get_node_group = ::Gapic::Config::Method.new get_node_group_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb new file mode 100644 index 000000000000..9be95d9e37b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + # Credentials for the NodeGroupController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb new file mode 100644 index 000000000000..96350ea26db8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the NodeGroupController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the NodeGroupController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb new file mode 100644 index 000000000000..885e4524f2c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + # Path helper methods for the NodeGroupController API. + module Paths + ## + # Create a fully-qualified ClusterRegion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/clusters/{cluster}` + # + # @param project [String] + # @param region [String] + # @param cluster [String] + # + # @return [::String] + def cluster_region_path project:, region:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified NodeGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` + # + # @param project [String] + # @param region [String] + # @param cluster [String] + # @param node_group [String] + # + # @return [::String] + def node_group_path project:, region:, cluster:, node_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb new file mode 100644 index 000000000000..05cf198c7fd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/node_group_controller/credentials" +require "google/cloud/dataproc/v1/node_group_controller/paths" +require "google/cloud/dataproc/v1/node_group_controller/rest/operations" +require "google/cloud/dataproc/v1/node_group_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The `NodeGroupControllerService` provides methods to manage node groups + # of Compute Engine managed instances. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/node_group_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + module NodeGroupController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/node_group_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb new file mode 100644 index 000000000000..4d201529afdb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb @@ -0,0 +1,679 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/node_groups_pb" +require "google/cloud/dataproc/v1/node_group_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + module Rest + ## + # REST client for the NodeGroupController service. + # + # The `NodeGroupControllerService` provides methods to manage node groups + # of Compute Engine managed instances. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :node_group_controller_stub + + ## + # Configure the NodeGroupController Client class. + # + # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all NodeGroupController clients + # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the NodeGroupController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @node_group_controller_stub.universe_domain + end + + ## + # Create a new NodeGroupController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the NodeGroupController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @node_group_controller_stub = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @node_group_controller_stub.endpoint + config.universe_domain = @node_group_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates a node group in a cluster. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + # + # @overload create_node_group(request, options = nil) + # Pass arguments to `create_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_node_group(parent: nil, node_group: nil, node_group_id: nil, request_id: nil) + # Pass arguments to `create_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this node group will be created. + # Format: `projects/{project}/regions/{region}/clusters/{cluster}` + # @param node_group [::Google::Cloud::Dataproc::V1::NodeGroup, ::Hash] + # Required. The node group to create. + # @param node_group_id [::String] + # Optional. An optional node group ID. Generated if not specified. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of from 3 to 33 characters. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new + # + # # Call the create_node_group method. + # result = client.create_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_node_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.create_node_group request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resizes a node group in a cluster. The returned + # {::Google::Longrunning::Operation#metadata Operation.metadata} is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + # + # @overload resize_node_group(request, options = nil) + # Pass arguments to `resize_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resize_node_group(name: nil, size: nil, request_id: nil, graceful_decommission_timeout: nil) + # Pass arguments to `resize_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the node group to resize. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + # @param size [::Integer] + # Required. The number of running instances for the node group to maintain. + # The group adds or removes instances to maintain the number of instances + # specified by this parameter. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] + # Optional. Timeout for graceful YARN decommissioning. [Graceful + # decommissioning] + # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + # allows the removal of nodes from the Compute Engine node group + # without interrupting jobs in progress. This timeout specifies how long to + # wait for jobs in progress to finish before forcefully removing nodes (and + # potentially interrupting jobs). Default timeout is 0 (for forceful + # decommission), and the maximum allowed timeout is 1 day. (see JSON + # representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new + # + # # Call the resize_node_group method. + # result = client.resize_node_group request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def resize_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.resize_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.resize_node_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resize_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.resize_node_group request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a node group in a + # cluster. + # + # @overload get_node_group(request, options = nil) + # Pass arguments to `get_node_group` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetNodeGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_node_group(name: nil) + # Pass arguments to `get_node_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the node group to retrieve. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::NodeGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::NodeGroup] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new + # + # # Call the get_node_group method. + # result = client.get_node_group request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. + # p result + # + def get_node_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_node_group.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_node_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_node_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @node_group_controller_stub.get_node_group request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the NodeGroupController REST API. + # + # This class represents the configuration for NodeGroupController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_node_group to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_node_group.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_node_group.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the NodeGroupController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_node_group + ## + # RPC-specific configuration for `resize_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :resize_node_group + ## + # RPC-specific configuration for `get_node_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node_group + + # @private + def initialize parent_rpcs = nil + create_node_group_config = parent_rpcs.create_node_group if parent_rpcs.respond_to? :create_node_group + @create_node_group = ::Gapic::Config::Method.new create_node_group_config + resize_node_group_config = parent_rpcs.resize_node_group if parent_rpcs.respond_to? :resize_node_group + @resize_node_group = ::Gapic::Config::Method.new resize_node_group_config + get_node_group_config = parent_rpcs.get_node_group if parent_rpcs.respond_to? :get_node_group + @get_node_group = ::Gapic::Config::Method.new get_node_group_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb new file mode 100644 index 000000000000..28876f4f1628 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the NodeGroupController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the NodeGroupController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb new file mode 100644 index 000000000000..ebede911fa7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb @@ -0,0 +1,248 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/node_groups_pb" + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + module Rest + ## + # REST service stub for the NodeGroupController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_node_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_node_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the resize_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def resize_node_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resize_node_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::NodeGroup] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::NodeGroup] + # A result object deserialized from the server's reply + def get_node_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_node_group_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::NodeGroup.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_node_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/nodeGroups", + body: "node_group", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resize_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resize_node_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:resize", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/nodeGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_node_group REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_node_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/nodeGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb new file mode 100644 index 000000000000..0d14395e4f9d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/node_groups.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/clusters_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n*google/cloud/dataproc/v1/node_groups.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/clusters.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\"\xc6\x01\n\x16\x43reateNodeGroupRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dataproc.googleapis.com/NodeGroup\x12<\n\nnode_group\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x16ResizeNodeGroupRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x1dgraceful_decommission_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"N\n\x13GetNodeGroupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dataproc.googleapis.com/NodeGroup2\xa7\x06\n\x13NodeGroupController\x12\x95\x02\n\x0f\x43reateNodeGroup\x12\x30.google.cloud.dataproc.v1.CreateNodeGroupRequest\x1a\x1d.google.longrunning.Operation\"\xb0\x01\xca\x41@\n\tNodeGroup\x12\x33google.cloud.dataproc.v1.NodeGroupOperationMetadata\xda\x41\x1fparent,node_group,node_group_id\x82\xd3\xe4\x93\x02\x45\"7/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups:\nnode_group\x12\xfd\x01\n\x0fResizeNodeGroup\x12\x30.google.cloud.dataproc.v1.ResizeNodeGroupRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41@\n\tNodeGroup\x12\x33google.cloud.dataproc.v1.NodeGroupOperationMetadata\xda\x41\tname,size\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize:\x01*\x12\xaa\x01\n\x0cGetNodeGroup\x12-.google.cloud.dataproc.v1.GetNodeGroupRequest\x1a#.google.cloud.dataproc.v1.NodeGroup\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1c\x63om.google.cloud.dataproc.v1B\x0fNodeGroupsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb\xea\x41_\n%dataproc.googleapis.com/ClusterRegion\x12\x36projects/{project}/regions/{region}/clusters/{cluster}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.dataproc.v1.NodeGroup", "google/cloud/dataproc/v1/clusters.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + CreateNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateNodeGroupRequest").msgclass + ResizeNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ResizeNodeGroupRequest").msgclass + GetNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetNodeGroupRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb new file mode 100644 index 000000000000..2bcb49d1f6c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/node_groups.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/node_groups_pb' + +module Google + module Cloud + module Dataproc + module V1 + module NodeGroupController + # The `NodeGroupControllerService` provides methods to manage node groups + # of Compute Engine managed instances. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.NodeGroupController' + + # Creates a node group in a cluster. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + rpc :CreateNodeGroup, ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Google::Longrunning::Operation + # Resizes a node group in a cluster. The returned + # [Operation.metadata][google.longrunning.Operation.metadata] is + # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + rpc :ResizeNodeGroup, ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Google::Longrunning::Operation + # Gets the resource representation for a node group in a + # cluster. + rpc :GetNodeGroup, ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Google::Cloud::Dataproc::V1::NodeGroup + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb new file mode 100644 index 000000000000..37fd96628b23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/operations.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/dataproc/v1/operations.proto\x12\x18google.cloud.dataproc.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe3\x03\n\x16\x42\x61tchOperationMetadata\x12\r\n\x05\x62\x61tch\x18\x01 \x01(\t\x12\x12\n\nbatch_uuid\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12[\n\x0eoperation_type\x18\x06 \x01(\x0e\x32\x43.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.cloud.dataproc.v1.BatchOperationMetadata.LabelsEntry\x12\x10\n\x08warnings\x18\t \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x12\x42\x61tchOperationType\x12$\n BATCH_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41TCH\x10\x01\"\x8f\x04\n\x18SessionOperationMetadata\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x14\n\x0csession_uuid\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12_\n\x0eoperation_type\x18\x06 \x01(\x0e\x32G.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12N\n\x06labels\x18\x08 \x03(\x0b\x32>.google.cloud.dataproc.v1.SessionOperationMetadata.LabelsEntry\x12\x10\n\x08warnings\x18\t \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"e\n\x14SessionOperationType\x12&\n\"SESSION_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\r\n\tTERMINATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\"\x89\x02\n\x16\x43lusterOperationStatus\x12J\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.dataproc.v1.ClusterOperationStatus.StateB\x03\xe0\x41\x03\x12\x18\n\x0binner_state\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x64\x65tails\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"8\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\"\xda\x03\n\x18\x43lusterOperationMetadata\x12\x19\n\x0c\x63luster_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06status\x18\t \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12M\n\x0estatus_history\x18\n \x03(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12\x1b\n\x0eoperation_type\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12S\n\x06labels\x18\r \x03(\x0b\x32>.google.cloud.dataproc.v1.ClusterOperationMetadata.LabelsEntryB\x03\xe0\x41\x03\x12\x15\n\x08warnings\x18\x0e \x03(\tB\x03\xe0\x41\x03\x12 \n\x13\x63hild_operation_ids\x18\x0f \x03(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfa\x04\n\x1aNodeGroupOperationMetadata\x12\x1a\n\rnode_group_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06status\x18\x03 \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12M\n\x0estatus_history\x18\x04 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12\x63\n\x0eoperation_type\x18\x05 \x01(\x0e\x32K.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12U\n\x06labels\x18\x07 \x03(\x0b\x32@.google.cloud.dataproc.v1.NodeGroupOperationMetadata.LabelsEntryB\x03\xe0\x41\x03\x12\x15\n\x08warnings\x18\x08 \x03(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"s\n\x16NodeGroupOperationType\x12)\n%NODE_GROUP_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\x12\n\n\x06RESIZE\x10\x04\x42n\n\x1c\x63om.google.cloud.dataproc.v1B\x0fOperationsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.BatchOperationMetadata").msgclass + BatchOperationMetadata::BatchOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType").enummodule + SessionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionOperationMetadata").msgclass + SessionOperationMetadata::SessionOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType").enummodule + ClusterOperationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationStatus").msgclass + ClusterOperationStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationStatus.State").enummodule + ClusterOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationMetadata").msgclass + NodeGroupOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupOperationMetadata").msgclass + NodeGroupOperationMetadata::NodeGroupOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb new file mode 100644 index 000000000000..24b3017ec96f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" +require "google/cloud/dataproc/v1/batch_controller/rest" +require "google/cloud/dataproc/v1/cluster_controller/rest" +require "google/cloud/dataproc/v1/job_controller/rest" +require "google/cloud/dataproc/v1/node_group_controller/rest" +require "google/cloud/dataproc/v1/session_controller/rest" +require "google/cloud/dataproc/v1/session_template_controller/rest" +require "google/cloud/dataproc/v1/workflow_template_service/rest" +require "google/cloud/dataproc/v1/bindings_override" +require "google/cloud/dataproc/v1/version" + +module Google + module Cloud + module Dataproc + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/dataproc/v1/rest" + # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb new file mode 100644 index 000000000000..08601d9fefeb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/session_controller/credentials" +require "google/cloud/dataproc/v1/session_controller/paths" +require "google/cloud/dataproc/v1/session_controller/operations" +require "google/cloud/dataproc/v1/session_controller/client" +require "google/cloud/dataproc/v1/session_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The `SessionController` provides methods to manage interactive sessions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/session_controller" + # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/session_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + module SessionController + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_controller", "helpers.rb" +require "google/cloud/dataproc/v1/session_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb new file mode 100644 index 000000000000..42990cbb6c07 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb @@ -0,0 +1,920 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/sessions_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + ## + # Client for the SessionController service. + # + # The `SessionController` provides methods to manage interactive sessions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_controller_stub + + ## + # Configure the SessionController Client class. + # + # See {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionController clients + # ::Google::Cloud::Dataproc::V1::SessionController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_controller_stub.universe_domain + end + + ## + # Create a new SessionController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/sessions_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @session_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::SessionController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_controller_stub.endpoint + config.universe_domain = @session_controller_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::SessionController::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Create an interactive session asynchronously. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session(parent: nil, session: nil, session_id: nil, request_id: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this session will be created. + # @param session [::Google::Cloud::Dataproc::V1::Session, ::Hash] + # Required. The interactive session to create. + # @param session_id [::String] + # Required. The ID to use for the session, which becomes the final component + # of the session's resource name. + # + # This value must be 4-63 characters. Valid characters + # are /[a-z][0-9]-/. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + # with the same ID, the second request is ignored, and the + # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in + # the backend. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.call_rpc :create_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for an interactive session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session(name: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::Session] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::Session] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.call_rpc :get_session, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists interactive sessions. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of sessions. + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @param page_token [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the sessions to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each session resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND, OR). + # Supported fields are `session_id`, `session_uuid`, `state`, and + # `create_time`. + # + # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + # is a filter for sessions in an ACTIVE state that were created before + # 2023-01-01. + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparators. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.call_rpc :list_sessions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_controller_stub, :list_sessions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Terminates the interactive session. + # + # @overload terminate_session(request, options = nil) + # Pass arguments to `terminate_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::TerminateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload terminate_session(name: nil, request_id: nil) + # Pass arguments to `terminate_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session resource to terminate. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new + # + # # Call the terminate_session method. + # result = client.terminate_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def terminate_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::TerminateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.terminate_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.terminate_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.terminate_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.call_rpc :terminate_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the interactive session resource. If the session is not in terminal + # state, it is terminated, and then deleted. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session(name: nil, request_id: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session resource to delete. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.call_rpc :delete_session, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionController API. + # + # This class represents the configuration for SessionController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::SessionController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SessionController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `terminate_session` + # @return [::Gapic::Config::Method] + # + attr_reader :terminate_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + terminate_session_config = parent_rpcs.terminate_session if parent_rpcs.respond_to? :terminate_session + @terminate_session = ::Gapic::Config::Method.new terminate_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb new file mode 100644 index 000000000000..d149bb6636cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + # Credentials for the SessionController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb new file mode 100644 index 000000000000..37acfc698a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SessionController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb new file mode 100644 index 000000000000..9f2b6b3cd83f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + # Path helper methods for the SessionController API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/services/#{service}" + end + + ## + # Create a fully-qualified Session resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # + # @return [::String] + def session_path project:, location:, session: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sessions/#{session}" + end + + ## + # Create a fully-qualified SessionTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sessionTemplates/{template}` + # + # @param project [String] + # @param location [String] + # @param template [String] + # + # @return [::String] + def session_template_path project:, location:, template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sessionTemplates/#{template}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb new file mode 100644 index 000000000000..35b6ab0a73a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/session_controller/credentials" +require "google/cloud/dataproc/v1/session_controller/paths" +require "google/cloud/dataproc/v1/session_controller/rest/operations" +require "google/cloud/dataproc/v1/session_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The `SessionController` provides methods to manage interactive sessions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/session_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + module SessionController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/session_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb new file mode 100644 index 000000000000..d3154613eb4a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb @@ -0,0 +1,867 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/sessions_pb" +require "google/cloud/dataproc/v1/session_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + module Rest + ## + # REST client for the SessionController service. + # + # The `SessionController` provides methods to manage interactive sessions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_controller_stub + + ## + # Configure the SessionController Client class. + # + # See {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionController clients + # ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_controller_stub.universe_domain + end + + ## + # Create a new SessionController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @session_controller_stub = ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_controller_stub.endpoint + config.universe_domain = @session_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::SessionController::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Create an interactive session asynchronously. + # + # @overload create_session(request, options = nil) + # Pass arguments to `create_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_session(parent: nil, session: nil, session_id: nil, request_id: nil) + # Pass arguments to `create_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this session will be created. + # @param session [::Google::Cloud::Dataproc::V1::Session, ::Hash] + # Required. The interactive session to create. + # @param session_id [::String] + # Required. The ID to use for the session, which becomes the final component + # of the session's resource name. + # + # This value must be 4-63 characters. Valid characters + # are /[a-z][0-9]-/. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + # with the same ID, the second request is ignored, and the + # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in + # the backend. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new + # + # # Call the create_session method. + # result = client.create_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.create_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for an interactive session. + # + # @overload get_session(request, options = nil) + # Pass arguments to `get_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_session(name: nil) + # Pass arguments to `get_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Session] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetSessionRequest.new + # + # # Call the get_session method. + # result = client.get_session request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::Session. + # p result + # + def get_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.get_session request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists interactive sessions. + # + # @overload list_sessions(request, options = nil) + # Pass arguments to `list_sessions` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListSessionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_sessions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent, which owns this collection of sessions. + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @param page_token [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the sessions to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each session resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND, OR). + # Supported fields are `session_id`, `session_uuid`, `state`, and + # `create_time`. + # + # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + # is a filter for sessions in an ACTIVE state that were created before + # 2023-01-01. + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparators. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new + # + # # Call the list_sessions method. + # result = client.list_sessions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::Session. + # p item + # end + # + def list_sessions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_sessions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sessions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.list_sessions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_controller_stub, :list_sessions, "sessions", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Terminates the interactive session. + # + # @overload terminate_session(request, options = nil) + # Pass arguments to `terminate_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::TerminateSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload terminate_session(name: nil, request_id: nil) + # Pass arguments to `terminate_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session resource to terminate. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new + # + # # Call the terminate_session method. + # result = client.terminate_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def terminate_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::TerminateSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.terminate_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.terminate_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.terminate_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.terminate_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes the interactive session resource. If the session is not in terminal + # state, it is terminated, and then deleted. + # + # @overload delete_session(request, options = nil) + # Pass arguments to `delete_session` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteSessionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_session(name: nil, request_id: nil) + # Pass arguments to `delete_session` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session resource to delete. + # @param request_id [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new + # + # # Call the delete_session method. + # result = client.delete_session request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_session request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_session.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_session.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_controller_stub.delete_session request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionController REST API. + # + # This class represents the configuration for SessionController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SessionController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session + ## + # RPC-specific configuration for `get_session` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session + ## + # RPC-specific configuration for `list_sessions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sessions + ## + # RPC-specific configuration for `terminate_session` + # @return [::Gapic::Config::Method] + # + attr_reader :terminate_session + ## + # RPC-specific configuration for `delete_session` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session + + # @private + def initialize parent_rpcs = nil + create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session + @create_session = ::Gapic::Config::Method.new create_session_config + get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session + @get_session = ::Gapic::Config::Method.new get_session_config + list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions + @list_sessions = ::Gapic::Config::Method.new list_sessions_config + terminate_session_config = parent_rpcs.terminate_session if parent_rpcs.respond_to? :terminate_session + @terminate_session = ::Gapic::Config::Method.new terminate_session_config + delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session + @delete_session = ::Gapic::Config::Method.new delete_session_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb new file mode 100644 index 000000000000..5a802e99e65e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the SessionController Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionController Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb new file mode 100644 index 000000000000..c1fce1800c60 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb @@ -0,0 +1,366 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/sessions_pb" + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + module Rest + ## + # REST service stub for the SessionController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::Session] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::Session] + # A result object deserialized from the server's reply + def get_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::Session.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListSessionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListSessionsResponse] + # A result object deserialized from the server's reply + def list_sessions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the terminate_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::TerminateSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def terminate_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_terminate_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_session request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessions", + body: "session", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sessions REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_sessions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the terminate_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::TerminateSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_terminate_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:terminate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_session_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb new file mode 100644 index 000000000000..ced4bf429763 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/session_template_controller/credentials" +require "google/cloud/dataproc/v1/session_template_controller/paths" +require "google/cloud/dataproc/v1/session_template_controller/client" +require "google/cloud/dataproc/v1/session_template_controller/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The SessionTemplateController provides methods to manage session templates. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/session_template_controller" + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/session_template_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + module SessionTemplateController + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_template_controller", "helpers.rb" +require "google/cloud/dataproc/v1/session_template_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb new file mode 100644 index 000000000000..aa5114e01620 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb @@ -0,0 +1,830 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/session_templates_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + ## + # Client for the SessionTemplateController service. + # + # The SessionTemplateController provides methods to manage session templates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_template_controller_stub + + ## + # Configure the SessionTemplateController Client class. + # + # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionTemplateController clients + # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionTemplateController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_template_controller_stub.universe_domain + end + + ## + # Create a new SessionTemplateController client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionTemplateController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/session_templates_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @session_template_controller_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_template_controller_stub.endpoint + config.universe_domain = @session_template_controller_stub.universe_domain + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Create a session template synchronously. + # + # @overload create_session_template(request, options = nil) + # Pass arguments to `create_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_session_template(parent: nil, session_template: nil) + # Pass arguments to `create_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this session template will be created. + # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] + # Required. The session template to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new + # + # # Call the create_session_template method. + # result = client.create_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def create_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_session_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.call_rpc :create_session_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the session template synchronously. + # + # @overload update_session_template(request, options = nil) + # Pass arguments to `update_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_session_template(session_template: nil) + # Pass arguments to `update_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] + # Required. The updated session template. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new + # + # # Call the update_session_template method. + # result = client.update_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def update_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.session_template&.name + header_params["session_template.name"] = request.session_template.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_session_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.call_rpc :update_session_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a session template. + # + # @overload get_session_template(request, options = nil) + # Pass arguments to `get_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_session_template(name: nil) + # Pass arguments to `get_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session template to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new + # + # # Call the get_session_template method. + # result = client.get_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def get_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_session_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.call_rpc :get_session_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists session templates. + # + # @overload list_session_templates(request, options = nil) + # Pass arguments to `list_session_templates` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_session_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent that owns this collection of session templates. + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @param page_token [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the session templates to return in the response. + # Filters are case sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new + # + # # Call the list_session_templates method. + # result = client.list_session_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. + # p item + # end + # + def list_session_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_session_templates.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_session_templates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_session_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.call_rpc :list_session_templates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_template_controller_stub, :list_session_templates, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a session template. + # + # @overload delete_session_template(request, options = nil) + # Pass arguments to `delete_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_session_template(name: nil) + # Pass arguments to `delete_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session template resource to delete. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new + # + # # Call the delete_session_template method. + # result = client.delete_session_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_session_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.call_rpc :delete_session_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionTemplateController API. + # + # This class represents the configuration for SessionTemplateController, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the SessionTemplateController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session_template + ## + # RPC-specific configuration for `update_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session_template + ## + # RPC-specific configuration for `get_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session_template + ## + # RPC-specific configuration for `list_session_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_session_templates + ## + # RPC-specific configuration for `delete_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session_template + + # @private + def initialize parent_rpcs = nil + create_session_template_config = parent_rpcs.create_session_template if parent_rpcs.respond_to? :create_session_template + @create_session_template = ::Gapic::Config::Method.new create_session_template_config + update_session_template_config = parent_rpcs.update_session_template if parent_rpcs.respond_to? :update_session_template + @update_session_template = ::Gapic::Config::Method.new update_session_template_config + get_session_template_config = parent_rpcs.get_session_template if parent_rpcs.respond_to? :get_session_template + @get_session_template = ::Gapic::Config::Method.new get_session_template_config + list_session_templates_config = parent_rpcs.list_session_templates if parent_rpcs.respond_to? :list_session_templates + @list_session_templates = ::Gapic::Config::Method.new list_session_templates_config + delete_session_template_config = parent_rpcs.delete_session_template if parent_rpcs.respond_to? :delete_session_template + @delete_session_template = ::Gapic::Config::Method.new delete_session_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb new file mode 100644 index 000000000000..30582ff19dbf --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + # Credentials for the SessionTemplateController API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb new file mode 100644 index 000000000000..e88c9536f34f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + # Path helper methods for the SessionTemplateController API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/services/#{service}" + end + + ## + # Create a fully-qualified SessionTemplate resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sessionTemplates/{template}` + # + # @param project [String] + # @param location [String] + # @param template [String] + # + # @return [::String] + def session_template_path project:, location:, template: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sessionTemplates/#{template}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb new file mode 100644 index 000000000000..8688762d4fbb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/session_template_controller/credentials" +require "google/cloud/dataproc/v1/session_template_controller/paths" +require "google/cloud/dataproc/v1/session_template_controller/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The SessionTemplateController provides methods to manage session templates. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/session_template_controller/rest" + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + module SessionTemplateController + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/session_template_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb new file mode 100644 index 000000000000..aa51672f9e46 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb @@ -0,0 +1,777 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/session_templates_pb" +require "google/cloud/dataproc/v1/session_template_controller/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + module Rest + ## + # REST client for the SessionTemplateController service. + # + # The SessionTemplateController provides methods to manage session templates. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_template_controller_stub + + ## + # Configure the SessionTemplateController Client class. + # + # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionTemplateController clients + # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionTemplateController Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @session_template_controller_stub.universe_domain + end + + ## + # Create a new SessionTemplateController REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionTemplateController client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @session_template_controller_stub = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @session_template_controller_stub.endpoint + config.universe_domain = @session_template_controller_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Create a session template synchronously. + # + # @overload create_session_template(request, options = nil) + # Pass arguments to `create_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_session_template(parent: nil, session_template: nil) + # Pass arguments to `create_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this session template will be created. + # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] + # Required. The session template to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new + # + # # Call the create_session_template method. + # result = client.create_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def create_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_session_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.create_session_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the session template synchronously. + # + # @overload update_session_template(request, options = nil) + # Pass arguments to `update_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_session_template(session_template: nil) + # Pass arguments to `update_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] + # Required. The updated session template. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new + # + # # Call the update_session_template method. + # result = client.update_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def update_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_session_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.update_session_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the resource representation for a session template. + # + # @overload get_session_template(request, options = nil) + # Pass arguments to `get_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_session_template(name: nil) + # Pass arguments to `get_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session template to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new + # + # # Call the get_session_template method. + # result = client.get_session_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + # p result + # + def get_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_session_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.get_session_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists session templates. + # + # @overload list_session_templates(request, options = nil) + # Pass arguments to `list_session_templates` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_session_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent that owns this collection of session templates. + # @param page_size [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @param page_token [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @param filter [::String] + # Optional. A filter for the session templates to return in the response. + # Filters are case sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new + # + # # Call the list_session_templates method. + # result = client.list_session_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. + # p item + # end + # + def list_session_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_session_templates.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_session_templates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_session_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.list_session_templates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_template_controller_stub, :list_session_templates, "session_templates", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a session template. + # + # @overload delete_session_template(request, options = nil) + # Pass arguments to `delete_session_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_session_template(name: nil) + # Pass arguments to `delete_session_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the session template resource to delete. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new + # + # # Call the delete_session_template method. + # result = client.delete_session_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_session_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_session_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_template_controller_stub.delete_session_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the SessionTemplateController REST API. + # + # This class represents the configuration for SessionTemplateController REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_session_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_session_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_session_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the SessionTemplateController API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session_template + ## + # RPC-specific configuration for `update_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session_template + ## + # RPC-specific configuration for `get_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session_template + ## + # RPC-specific configuration for `list_session_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_session_templates + ## + # RPC-specific configuration for `delete_session_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session_template + + # @private + def initialize parent_rpcs = nil + create_session_template_config = parent_rpcs.create_session_template if parent_rpcs.respond_to? :create_session_template + @create_session_template = ::Gapic::Config::Method.new create_session_template_config + update_session_template_config = parent_rpcs.update_session_template if parent_rpcs.respond_to? :update_session_template + @update_session_template = ::Gapic::Config::Method.new update_session_template_config + get_session_template_config = parent_rpcs.get_session_template if parent_rpcs.respond_to? :get_session_template + @get_session_template = ::Gapic::Config::Method.new get_session_template_config + list_session_templates_config = parent_rpcs.list_session_templates if parent_rpcs.respond_to? :list_session_templates + @list_session_templates = ::Gapic::Config::Method.new list_session_templates_config + delete_session_template_config = parent_rpcs.delete_session_template if parent_rpcs.respond_to? :delete_session_template + @delete_session_template = ::Gapic::Config::Method.new delete_session_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb new file mode 100644 index 000000000000..59d3fc963d59 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb @@ -0,0 +1,366 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/session_templates_pb" + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + module Rest + ## + # REST service stub for the SessionTemplateController service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # A result object deserialized from the server's reply + def create_session_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # A result object deserialized from the server's reply + def update_session_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_session_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # A result object deserialized from the server's reply + def get_session_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_session_templates REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse] + # A result object deserialized from the server's reply + def list_session_templates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_session_templates_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_session_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_session_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sessionTemplates", + body: "session_template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_session_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{session_template.name}", + body: "session_template", + matches: [ + ["session_template.name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_session_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_session_templates REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_session_templates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sessionTemplates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_session_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb new file mode 100644 index 000000000000..a1ae97853390 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/session_templates.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/sessions_pb' +require 'google/cloud/dataproc/v1/shared_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n0google/cloud/dataproc/v1/session_templates.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/sessions.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x01\n\x1c\x43reateSessionTemplateRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dataproc.googleapis.com/SessionTemplate\x12H\n\x10session_template\x18\x03 \x01(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x02\"h\n\x1cUpdateSessionTemplateRequest\x12H\n\x10session_template\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x02\"Z\n\x19GetSessionTemplateRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\"\xa4\x01\n\x1bListSessionTemplatesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dataproc.googleapis.com/SessionTemplate\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x1cListSessionTemplatesResponse\x12I\n\x11session_templates\x18\x01 \x03(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x03\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x1c\x44\x65leteSessionTemplateRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\"\xb0\x05\n\x0fSessionTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0fjupyter_session\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JupyterConfigB\x03\xe0\x41\x01H\x00\x12\x14\n\x07\x63reator\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12J\n\x06labels\x18\x06 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.SessionTemplate.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\x08 \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04uuid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:q\xea\x41n\n\'dataproc.googleapis.com/SessionTemplate\x12\x43projects/{project}/locations/{location}/sessionTemplates/{template}B\x10\n\x0esession_config2\xfa\x08\n\x19SessionTemplateController\x12\xe4\x01\n\x15\x43reateSessionTemplate\x12\x36.google.cloud.dataproc.v1.CreateSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"h\xda\x41\x17parent,session_template\x82\xd3\xe4\x93\x02H\"4/v1/{parent=projects/*/locations/*}/sessionTemplates:\x10session_template\x12\xee\x01\n\x15UpdateSessionTemplate\x12\x36.google.cloud.dataproc.v1.UpdateSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"r\xda\x41\x10session_template\x82\xd3\xe4\x93\x02Y2E/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}:\x10session_template\x12\xb9\x01\n\x12GetSessionTemplate\x12\x33.google.cloud.dataproc.v1.GetSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/sessionTemplates/*}\x12\xcc\x01\n\x14ListSessionTemplates\x12\x35.google.cloud.dataproc.v1.ListSessionTemplatesRequest\x1a\x36.google.cloud.dataproc.v1.ListSessionTemplatesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/sessionTemplates\x12\xac\x01\n\x15\x44\x65leteSessionTemplate\x12\x36.google.cloud.dataproc.v1.DeleteSessionTemplateRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/sessionTemplates/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBt\n\x1c\x63om.google.cloud.dataproc.v1B\x15SessionTemplatesProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dataproc.v1.JupyterConfig", "google/cloud/dataproc/v1/sessions.proto"], + ["google.cloud.dataproc.v1.RuntimeConfig", "google/cloud/dataproc/v1/shared.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + CreateSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateSessionTemplateRequest").msgclass + UpdateSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateSessionTemplateRequest").msgclass + GetSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetSessionTemplateRequest").msgclass + ListSessionTemplatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionTemplatesRequest").msgclass + ListSessionTemplatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionTemplatesResponse").msgclass + DeleteSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteSessionTemplateRequest").msgclass + SessionTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionTemplate").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb new file mode 100644 index 000000000000..7d4cb14458b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/session_templates.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/session_templates_pb' + +module Google + module Cloud + module Dataproc + module V1 + module SessionTemplateController + # The SessionTemplateController provides methods to manage session templates. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.SessionTemplateController' + + # Create a session template synchronously. + rpc :CreateSessionTemplate, ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate + # Updates the session template synchronously. + rpc :UpdateSessionTemplate, ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate + # Gets the resource representation for a session template. + rpc :GetSessionTemplate, ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate + # Lists session templates. + rpc :ListSessionTemplates, ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse + # Deletes a session template. + rpc :DeleteSessionTemplate, ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb new file mode 100644 index 000000000000..e6f139356d0e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/sessions.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/shared_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\'google/cloud/dataproc/v1/sessions.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xba\x01\n\x14\x43reateSessionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64\x61taproc.googleapis.com/Session\x12\x37\n\x07session\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.SessionB\x03\xe0\x41\x02\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"J\n\x11GetSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\"\x94\x01\n\x13ListSessionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64\x61taproc.googleapis.com/Session\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"i\n\x14ListSessionsResponse\x12\x38\n\x08sessions\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.SessionB\x03\xe0\x41\x03\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x17TerminateSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd3\t\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0fjupyter_session\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JupyterConfigB\x03\xe0\x41\x01H\x00\x12@\n\x0cruntime_info\x18\x06 \x01(\x0b\x32%.google.cloud.dataproc.v1.RuntimeInfoB\x03\xe0\x41\x03\x12;\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.dataproc.v1.Session.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07\x63reator\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x0b \x03(\x0b\x32-.google.cloud.dataproc.v1.Session.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x0c \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x11\n\x04user\x18\x0e \x01(\tB\x03\xe0\x41\x01\x12Q\n\rstate_history\x18\x0f \x03(\x0b\x32\x35.google.cloud.dataproc.v1.Session.SessionStateHistoryB\x03\xe0\x41\x03\x12I\n\x10session_template\x18\x10 \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\x1a\xa9\x01\n\x13SessionStateHistory\x12;\n\x05state\x18\x01 \x01(\x0e\x32\'.google.cloud.dataproc.v1.Session.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0f\n\x0bTERMINATING\x10\x03\x12\x0e\n\nTERMINATED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:`\xea\x41]\n\x1f\x64\x61taproc.googleapis.com/Session\x12:projects/{project}/locations/{location}/sessions/{session}B\x10\n\x0esession_config\"\xa8\x01\n\rJupyterConfig\x12\x43\n\x06kernel\x18\x01 \x01(\x0e\x32..google.cloud.dataproc.v1.JupyterConfig.KernelB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\"7\n\x06Kernel\x12\x16\n\x12KERNEL_UNSPECIFIED\x10\x00\x12\n\n\x06PYTHON\x10\x01\x12\t\n\x05SCALA\x10\x02\x32\xf5\x08\n\x11SessionController\x12\xf9\x01\n\rCreateSession\x12..google.cloud.dataproc.v1.CreateSessionRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x19parent,session,session_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/sessions:\x07session\x12\x99\x01\n\nGetSession\x12+.google.cloud.dataproc.v1.GetSessionRequest\x1a!.google.cloud.dataproc.v1.Session\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/sessions/*}\x12\xac\x01\n\x0cListSessions\x12-.google.cloud.dataproc.v1.ListSessionsRequest\x1a..google.cloud.dataproc.v1.ListSessionsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/sessions\x12\xee\x01\n\x10TerminateSession\x12\x31.google.cloud.dataproc.v1.TerminateSessionRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/sessions/*}:terminate:\x01*\x12\xda\x01\n\rDeleteSession\x12..google.cloud.dataproc.v1.DeleteSessionRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/sessions/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rSessionsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.dataproc.v1.RuntimeInfo", "google/cloud/dataproc/v1/shared.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + CreateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateSessionRequest").msgclass + GetSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetSessionRequest").msgclass + ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionsRequest").msgclass + ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionsResponse").msgclass + TerminateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.TerminateSessionRequest").msgclass + DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteSessionRequest").msgclass + Session = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session").msgclass + Session::SessionStateHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session.SessionStateHistory").msgclass + Session::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session.State").enummodule + JupyterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JupyterConfig").msgclass + JupyterConfig::Kernel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JupyterConfig.Kernel").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb new file mode 100644 index 000000000000..7d120abf7862 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dataproc/v1/sessions.proto for package 'google.cloud.dataproc.v1' +# Original file comments: +# Copyright 2024 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 +# +# http://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. +# + +require 'grpc' +require 'google/cloud/dataproc/v1/sessions_pb' + +module Google + module Cloud + module Dataproc + module V1 + module SessionController + # The `SessionController` provides methods to manage interactive sessions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dataproc.v1.SessionController' + + # Create an interactive session asynchronously. + rpc :CreateSession, ::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Google::Longrunning::Operation + # Gets the resource representation for an interactive session. + rpc :GetSession, ::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Google::Cloud::Dataproc::V1::Session + # Lists interactive sessions. + rpc :ListSessions, ::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Google::Cloud::Dataproc::V1::ListSessionsResponse + # Terminates the interactive session. + rpc :TerminateSession, ::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Google::Longrunning::Operation + # Deletes the interactive session resource. If the session is not in terminal + # state, it is terminated, and then deleted. + rpc :DeleteSession, ::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb new file mode 100644 index 000000000000..57b16e879b03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/shared.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/dataproc/v1/shared.proto\x12\x18google.cloud.dataproc.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x02\n\rRuntimeConfig\x12\x14\n\x07version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63ontainer_image\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12P\n\nproperties\x18\x03 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.RuntimeConfig.PropertiesEntryB\x03\xe0\x41\x01\x12J\n\x11repository_config\x18\x05 \x01(\x0b\x32*.google.cloud.dataproc.v1.RepositoryConfigB\x03\xe0\x41\x01\x12J\n\x11\x61utotuning_config\x18\x06 \x01(\x0b\x32*.google.cloud.dataproc.v1.AutotuningConfigB\x03\xe0\x41\x01\x12\x13\n\x06\x63ohort\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xab\x01\n\x11\x45nvironmentConfig\x12H\n\x10\x65xecution_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.ExecutionConfigB\x03\xe0\x41\x01\x12L\n\x12peripherals_config\x18\x02 \x01(\x0b\x32+.google.cloud.dataproc.v1.PeripheralsConfigB\x03\xe0\x41\x01\"\xa2\x02\n\x0f\x45xecutionConfig\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\x0bnetwork_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x1d\n\x0esubnetwork_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x19\n\x0cnetwork_tags\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12\x14\n\x07kms_key\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x30\n\x08idle_ttl\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12+\n\x03ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\x0estaging_bucket\x18\n \x01(\tB\x03\xe0\x41\x01\x42\t\n\x07network\"9\n\x18SparkHistoryServerConfig\x12\x1d\n\x10\x64\x61taproc_cluster\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xb6\x01\n\x11PeripheralsConfig\x12\x43\n\x11metastore_service\x18\x01 \x01(\tB(\xe0\x41\x01\xfa\x41\"\n metastore.googleapis.com/Service\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xd7\x02\n\x0bRuntimeInfo\x12L\n\tendpoints\x18\x01 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.RuntimeInfo.EndpointsEntryB\x03\xe0\x41\x03\x12\x17\n\noutput_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15\x64iagnostic_output_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x11\x61pproximate_usage\x18\x06 \x01(\x0b\x32&.google.cloud.dataproc.v1.UsageMetricsB\x03\xe0\x41\x03\x12\x43\n\rcurrent_usage\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.UsageSnapshotB\x03\xe0\x41\x03\x1a\x30\n\x0e\x45ndpointsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9e\x01\n\x0cUsageMetrics\x12\x1e\n\x11milli_dcu_seconds\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\'\n\x1ashuffle_storage_gb_seconds\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12&\n\x19milli_accelerator_seconds\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x88\x02\n\rUsageSnapshot\x12\x16\n\tmilli_dcu\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1f\n\x12shuffle_storage_gb\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11milli_dcu_premium\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12\'\n\x1ashuffle_storage_gb_premium\x18\x05 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11milli_accelerator\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x36\n\rsnapshot_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa4\x01\n\x10GkeClusterConfig\x12\x44\n\x12gke_cluster_target\x18\x02 \x01(\tB(\xe0\x41\x01\xfa\x41\"\n container.googleapis.com/Cluster\x12J\n\x10node_pool_target\x18\x03 \x03(\x0b\x32+.google.cloud.dataproc.v1.GkeNodePoolTargetB\x03\xe0\x41\x01\"\xf2\x01\n\x17KubernetesClusterConfig\x12!\n\x14kubernetes_namespace\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12M\n\x12gke_cluster_config\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.GkeClusterConfigB\x03\xe0\x41\x02H\x00\x12[\n\x1akubernetes_software_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.KubernetesSoftwareConfigB\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\"\xc3\x02\n\x18KubernetesSoftwareConfig\x12\x63\n\x11\x63omponent_version\x18\x01 \x03(\x0b\x32H.google.cloud.dataproc.v1.KubernetesSoftwareConfig.ComponentVersionEntry\x12V\n\nproperties\x18\x02 \x03(\x0b\x32\x42.google.cloud.dataproc.v1.KubernetesSoftwareConfig.PropertiesEntry\x1a\x37\n\x15\x43omponentVersionEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9e\x02\n\x11GkeNodePoolTarget\x12\x16\n\tnode_pool\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x05roles\x18\x02 \x03(\x0e\x32\x30.google.cloud.dataproc.v1.GkeNodePoolTarget.RoleB\x03\xe0\x41\x02\x12J\n\x10node_pool_config\x18\x03 \x01(\x0b\x32+.google.cloud.dataproc.v1.GkeNodePoolConfigB\x03\xe0\x41\x04\"_\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0e\n\nCONTROLLER\x10\x02\x12\x10\n\x0cSPARK_DRIVER\x10\x03\x12\x12\n\x0eSPARK_EXECUTOR\x10\x04\"\xbc\x05\n\x11GkeNodePoolConfig\x12N\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x39.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfigB\x03\xe0\x41\x01\x12\x16\n\tlocations\x18\r \x03(\tB\x03\xe0\x41\x01\x12\x62\n\x0b\x61utoscaling\x18\x04 \x01(\x0b\x32H.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfigB\x03\xe0\x41\x01\x1a\x99\x02\n\rGkeNodeConfig\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0flocal_ssd_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0bpreemptible\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12\x63\n\x0c\x61\x63\x63\x65lerators\x18\x0b \x03(\x0b\x32H.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_kms_key\x18\x17 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04spot\x18 \x01(\x08\x42\x03\xe0\x41\x01\x1ao\n\x1cGkeNodePoolAcceleratorConfig\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\t\x12\x1a\n\x12gpu_partition_size\x18\x03 \x01(\t\x1aN\n\x1cGkeNodePoolAutoscalingConfig\x12\x16\n\x0emin_node_count\x18\x02 \x01(\x05\x12\x16\n\x0emax_node_count\x18\x03 \x01(\x05\"\xb7\x01\n\x10\x41utotuningConfig\x12K\n\tscenarios\x18\x02 \x03(\x0e\x32\x33.google.cloud.dataproc.v1.AutotuningConfig.ScenarioB\x03\xe0\x41\x01\"V\n\x08Scenario\x12\x18\n\x14SCENARIO_UNSPECIFIED\x10\x00\x12\x0b\n\x07SCALING\x10\x02\x12\x17\n\x13\x42ROADCAST_HASH_JOIN\x10\x03\x12\n\n\x06MEMORY\x10\x04\"g\n\x10RepositoryConfig\x12S\n\x16pypi_repository_config\x18\x01 \x01(\x0b\x32..google.cloud.dataproc.v1.PyPiRepositoryConfigB\x03\xe0\x41\x01\"4\n\x14PyPiRepositoryConfig\x12\x1c\n\x0fpypi_repository\x18\x01 \x01(\tB\x03\xe0\x41\x01*\xd4\x01\n\tComponent\x12\x19\n\x15\x43OMPONENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41NACONDA\x10\x05\x12\n\n\x06\x44OCKER\x10\r\x12\t\n\x05\x44RUID\x10\t\x12\t\n\x05\x46LINK\x10\x0e\x12\t\n\x05HBASE\x10\x0b\x12\x10\n\x0cHIVE_WEBHCAT\x10\x03\x12\x08\n\x04HUDI\x10\x12\x12\x0b\n\x07JUPYTER\x10\x01\x12\n\n\x06PRESTO\x10\x06\x12\t\n\x05TRINO\x10\x11\x12\n\n\x06RANGER\x10\x0c\x12\x08\n\x04SOLR\x10\n\x12\x0c\n\x08ZEPPELIN\x10\x04\x12\r\n\tZOOKEEPER\x10\x08*J\n\rFailureAction\x12\x1e\n\x1a\x46\x41ILURE_ACTION_UNSPECIFIED\x10\x00\x12\r\n\tNO_ACTION\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x42\xac\x02\n\x1c\x63om.google.cloud.dataproc.v1B\x0bSharedProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb\xea\x41^\n container.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}\xea\x41^\n metastore.googleapis.com/Service\x12:projects/{project}/locations/{location}/services/{service}b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Dataproc + module V1 + RuntimeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RuntimeConfig").msgclass + EnvironmentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EnvironmentConfig").msgclass + ExecutionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ExecutionConfig").msgclass + SparkHistoryServerConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkHistoryServerConfig").msgclass + PeripheralsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PeripheralsConfig").msgclass + RuntimeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RuntimeInfo").msgclass + UsageMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UsageMetrics").msgclass + UsageSnapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UsageSnapshot").msgclass + GkeClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeClusterConfig").msgclass + KubernetesClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KubernetesClusterConfig").msgclass + KubernetesSoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KubernetesSoftwareConfig").msgclass + GkeNodePoolTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolTarget").msgclass + GkeNodePoolTarget::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolTarget.Role").enummodule + GkeNodePoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig").msgclass + GkeNodePoolConfig::GkeNodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig").msgclass + GkeNodePoolConfig::GkeNodePoolAcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig").msgclass + GkeNodePoolConfig::GkeNodePoolAutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig").msgclass + AutotuningConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutotuningConfig").msgclass + AutotuningConfig::Scenario = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutotuningConfig.Scenario").enummodule + RepositoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RepositoryConfig").msgclass + PyPiRepositoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PyPiRepositoryConfig").msgclass + Component = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Component").enummodule + FailureAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.FailureAction").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb new file mode 100644 index 000000000000..8e3ed3953392 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb new file mode 100644 index 000000000000..602d10ccaf8d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" + +require "google/cloud/dataproc/v1/workflow_template_service/credentials" +require "google/cloud/dataproc/v1/workflow_template_service/paths" +require "google/cloud/dataproc/v1/workflow_template_service/operations" +require "google/cloud/dataproc/v1/workflow_template_service/client" +require "google/cloud/dataproc/v1/workflow_template_service/rest" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The API interface for managing Workflow Templates in the + # Dataproc API. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dataproc/v1/workflow_template_service" + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dataproc/v1/workflow_template_service/rest" + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + module WorkflowTemplateService + end + end + end + end +end + +helper_path = ::File.join __dir__, "workflow_template_service", "helpers.rb" +require "google/cloud/dataproc/v1/workflow_template_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb new file mode 100644 index 000000000000..4ec2e557e116 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb @@ -0,0 +1,1220 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/workflow_templates_pb" +require "google/iam/v1" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + ## + # Client for the WorkflowTemplateService service. + # + # The API interface for managing Workflow Templates in the + # Dataproc API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflow_template_service_stub + + ## + # Configure the WorkflowTemplateService Client class. + # + # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WorkflowTemplateService clients + # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_workflow_template.timeout = 600.0 + default_config.rpcs.create_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_workflow_template.timeout = 600.0 + default_config.rpcs.get_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.instantiate_workflow_template.timeout = 600.0 + default_config.rpcs.instantiate_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.instantiate_inline_workflow_template.timeout = 600.0 + default_config.rpcs.instantiate_inline_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_workflow_template.timeout = 600.0 + default_config.rpcs.update_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workflow_templates.timeout = 600.0 + default_config.rpcs.list_workflow_templates.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.delete_workflow_template.timeout = 600.0 + default_config.rpcs.delete_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WorkflowTemplateService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @workflow_template_service_stub.universe_domain + end + + ## + # Create a new WorkflowTemplateService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WorkflowTemplateService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/dataproc/v1/workflow_templates_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @workflow_template_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflow_template_service_stub.endpoint + config.universe_domain = @workflow_template_service_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates new workflow template. + # + # @overload create_workflow_template(request, options = nil) + # Pass arguments to `create_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_workflow_template(parent: nil, template: nil) + # Pass arguments to `create_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.create`, the resource name of the + # region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.create`, the resource name of + # the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The Dataproc workflow template to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new + # + # # Call the create_workflow_template method. + # result = client.create_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def create_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :create_workflow_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the latest workflow template. + # + # Can retrieve previously instantiated template by specifying optional + # version parameter. + # + # @overload get_workflow_template(request, options = nil) + # Pass arguments to `get_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_workflow_template(name: nil, version: nil) + # Pass arguments to `get_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to retrieve. Only previously + # instantiated versions can be retrieved. + # + # If unspecified, retrieves the current version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new + # + # # Call the get_workflow_template method. + # result = client.get_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def get_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :get_workflow_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Instantiates a template and begins execution. + # + # The returned Operation can be used to track execution of + # workflow by polling + # operations.get. + # The Operation will complete when entire workflow is finished. + # + # The running workflow can be aborted via + # operations.cancel. + # This will cause any inflight jobs to be cancelled and workflow-owned + # clusters to be deleted. + # + # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + # Also see [Using + # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + # + # On successful completion, + # {::Google::Longrunning::Operation#response Operation.response} will be + # {::Google::Protobuf::Empty Empty}. + # + # @overload instantiate_workflow_template(request, options = nil) + # Pass arguments to `instantiate_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload instantiate_workflow_template(name: nil, version: nil, request_id: nil, parameters: nil) + # Pass arguments to `instantiate_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to instantiate. If specified, + # the workflow will be instantiated only if the current version of + # the workflow template has the supplied version. + # + # This option cannot be used to instantiate a previous version of + # workflow template. + # @param request_id [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param parameters [::Hash{::String => ::String}] + # Optional. Map from parameter names to values that should be used for those + # parameters. Values may not exceed 1000 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new + # + # # Call the instantiate_workflow_template method. + # result = client.instantiate_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def instantiate_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.instantiate_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.instantiate_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.instantiate_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :instantiate_workflow_template, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Instantiates a template and begins execution. + # + # This method is equivalent to executing the sequence + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template CreateWorkflowTemplate}, + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template InstantiateWorkflowTemplate}, + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template DeleteWorkflowTemplate}. + # + # The returned Operation can be used to track execution of + # workflow by polling + # operations.get. + # The Operation will complete when entire workflow is finished. + # + # The running workflow can be aborted via + # operations.cancel. + # This will cause any inflight jobs to be cancelled and workflow-owned + # clusters to be deleted. + # + # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + # Also see [Using + # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + # + # On successful completion, + # {::Google::Longrunning::Operation#response Operation.response} will be + # {::Google::Protobuf::Empty Empty}. + # + # @overload instantiate_inline_workflow_template(request, options = nil) + # Pass arguments to `instantiate_inline_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload instantiate_inline_workflow_template(parent: nil, template: nil, request_id: nil) + # Pass arguments to `instantiate_inline_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,instantiateinline`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.instantiateinline`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The workflow template to instantiate. + # @param request_id [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new + # + # # Call the instantiate_inline_workflow_template method. + # result = client.instantiate_inline_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def instantiate_inline_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.instantiate_inline_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.instantiate_inline_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.instantiate_inline_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :instantiate_inline_workflow_template, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates (replaces) workflow template. The updated template + # must contain version that matches the current server version. + # + # @overload update_workflow_template(request, options = nil) + # Pass arguments to `update_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_workflow_template(template: nil) + # Pass arguments to `update_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The updated workflow template. + # + # The `template.version` field must match the current version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new + # + # # Call the update_workflow_template method. + # result = client.update_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def update_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.template&.name + header_params["template.name"] = request.template.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :update_workflow_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists workflows that match the specified filter in the request. + # + # @overload list_workflow_templates(request, options = nil) + # Pass arguments to `list_workflow_templates` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_workflow_templates(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workflow_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,list`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.list`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in each response. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new + # + # # Call the list_workflow_templates method. + # result = client.list_workflow_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p item + # end + # + def list_workflow_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_workflow_templates.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_workflow_templates.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workflow_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :list_workflow_templates, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workflow_template_service_stub, :list_workflow_templates, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a workflow template. It does not cancel in-progress workflows. + # + # @overload delete_workflow_template(request, options = nil) + # Pass arguments to `delete_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_workflow_template(name: nil, version: nil) + # Pass arguments to `delete_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.delete`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to delete. If specified, + # will only delete the template if the current server version matches + # specified version. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new + # + # # Call the delete_workflow_template method. + # result = client.delete_workflow_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_workflow_template.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.call_rpc :delete_workflow_template, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the WorkflowTemplateService API. + # + # This class represents the configuration for WorkflowTemplateService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_workflow_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_workflow_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_workflow_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the WorkflowTemplateService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow_template + ## + # RPC-specific configuration for `get_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow_template + ## + # RPC-specific configuration for `instantiate_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :instantiate_workflow_template + ## + # RPC-specific configuration for `instantiate_inline_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :instantiate_inline_workflow_template + ## + # RPC-specific configuration for `update_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow_template + ## + # RPC-specific configuration for `list_workflow_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflow_templates + ## + # RPC-specific configuration for `delete_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow_template + + # @private + def initialize parent_rpcs = nil + create_workflow_template_config = parent_rpcs.create_workflow_template if parent_rpcs.respond_to? :create_workflow_template + @create_workflow_template = ::Gapic::Config::Method.new create_workflow_template_config + get_workflow_template_config = parent_rpcs.get_workflow_template if parent_rpcs.respond_to? :get_workflow_template + @get_workflow_template = ::Gapic::Config::Method.new get_workflow_template_config + instantiate_workflow_template_config = parent_rpcs.instantiate_workflow_template if parent_rpcs.respond_to? :instantiate_workflow_template + @instantiate_workflow_template = ::Gapic::Config::Method.new instantiate_workflow_template_config + instantiate_inline_workflow_template_config = parent_rpcs.instantiate_inline_workflow_template if parent_rpcs.respond_to? :instantiate_inline_workflow_template + @instantiate_inline_workflow_template = ::Gapic::Config::Method.new instantiate_inline_workflow_template_config + update_workflow_template_config = parent_rpcs.update_workflow_template if parent_rpcs.respond_to? :update_workflow_template + @update_workflow_template = ::Gapic::Config::Method.new update_workflow_template_config + list_workflow_templates_config = parent_rpcs.list_workflow_templates if parent_rpcs.respond_to? :list_workflow_templates + @list_workflow_templates = ::Gapic::Config::Method.new list_workflow_templates_config + delete_workflow_template_config = parent_rpcs.delete_workflow_template if parent_rpcs.respond_to? :delete_workflow_template + @delete_workflow_template = ::Gapic::Config::Method.new delete_workflow_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb new file mode 100644 index 000000000000..986bbe754467 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + # Credentials for the WorkflowTemplateService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "DATAPROC_CREDENTIALS", + "DATAPROC_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DATAPROC_CREDENTIALS_JSON", + "DATAPROC_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb new file mode 100644 index 000000000000..f6c27c1f967a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the WorkflowTemplateService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the WorkflowTemplateService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb new file mode 100644 index 000000000000..efcbebb42259 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + # Path helper methods for the WorkflowTemplateService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified NodeGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` + # + # @param project [String] + # @param region [String] + # @param cluster [String] + # @param node_group [String] + # + # @return [::String] + def node_group_path project:, region:, cluster:, node_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" + end + + ## + # Create a fully-qualified Region resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}` + # + # @param project [String] + # @param region [String] + # + # @return [::String] + def region_path project:, region: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/regions/#{region}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/services/#{service}" + end + + ## + # Create a fully-qualified WorkflowTemplate resource string. + # + # @overload workflow_template_path(project:, region:, workflow_template:) + # The resource will be in the following format: + # + # `projects/{project}/regions/{region}/workflowTemplates/{workflow_template}` + # + # @param project [String] + # @param region [String] + # @param workflow_template [String] + # + # @overload workflow_template_path(project:, location:, workflow_template:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflowTemplates/{workflow_template}` + # + # @param project [String] + # @param location [String] + # @param workflow_template [String] + # + # @return [::String] + def workflow_template_path **args + resources = { + "project:region:workflow_template" => (proc do |project:, region:, workflow_template:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" + + "projects/#{project}/regions/#{region}/workflowTemplates/#{workflow_template}" + end), + "location:project:workflow_template" => (proc do |project:, location:, workflow_template:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflowTemplates/#{workflow_template}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb new file mode 100644 index 000000000000..0bd0d601c6a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dataproc/v1/version" +require "google/cloud/dataproc/v1/bindings_override" + +require "google/cloud/dataproc/v1/workflow_template_service/credentials" +require "google/cloud/dataproc/v1/workflow_template_service/paths" +require "google/cloud/dataproc/v1/workflow_template_service/rest/operations" +require "google/cloud/dataproc/v1/workflow_template_service/rest/client" + +module Google + module Cloud + module Dataproc + module V1 + ## + # The API interface for managing Workflow Templates in the + # Dataproc API. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dataproc/v1/workflow_template_service/rest" + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + module WorkflowTemplateService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dataproc/v1/workflow_template_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb new file mode 100644 index 000000000000..fbbea732e848 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb @@ -0,0 +1,1153 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/dataproc/v1/workflow_templates_pb" +require "google/cloud/dataproc/v1/workflow_template_service/rest/service_stub" +require "google/iam/v1/rest" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + module Rest + ## + # REST client for the WorkflowTemplateService service. + # + # The API interface for managing Workflow Templates in the + # Dataproc API. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflow_template_service_stub + + ## + # Configure the WorkflowTemplateService Client class. + # + # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WorkflowTemplateService clients + # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dataproc", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_workflow_template.timeout = 600.0 + default_config.rpcs.create_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_workflow_template.timeout = 600.0 + default_config.rpcs.get_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.instantiate_workflow_template.timeout = 600.0 + default_config.rpcs.instantiate_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.instantiate_inline_workflow_template.timeout = 600.0 + default_config.rpcs.instantiate_inline_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_workflow_template.timeout = 600.0 + default_config.rpcs.update_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workflow_templates.timeout = 600.0 + default_config.rpcs.list_workflow_templates.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] + } + + default_config.rpcs.delete_workflow_template.timeout = 600.0 + default_config.rpcs.delete_workflow_template.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WorkflowTemplateService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @workflow_template_service_stub.universe_domain + end + + ## + # Create a new WorkflowTemplateService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WorkflowTemplateService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @workflow_template_service_stub = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @workflow_template_service_stub.endpoint + config.universe_domain = @workflow_template_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Rest::Client] + # + attr_reader :iam_policy_client + + # Service calls + + ## + # Creates new workflow template. + # + # @overload create_workflow_template(request, options = nil) + # Pass arguments to `create_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_workflow_template(parent: nil, template: nil) + # Pass arguments to `create_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.create`, the resource name of the + # region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.create`, the resource name of + # the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The Dataproc workflow template to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new + # + # # Call the create_workflow_template method. + # result = client.create_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def create_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.create_workflow_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves the latest workflow template. + # + # Can retrieve previously instantiated template by specifying optional + # version parameter. + # + # @overload get_workflow_template(request, options = nil) + # Pass arguments to `get_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_workflow_template(name: nil, version: nil) + # Pass arguments to `get_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to retrieve. Only previously + # instantiated versions can be retrieved. + # + # If unspecified, retrieves the current version. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new + # + # # Call the get_workflow_template method. + # result = client.get_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def get_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.get_workflow_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Instantiates a template and begins execution. + # + # The returned Operation can be used to track execution of + # workflow by polling + # operations.get. + # The Operation will complete when entire workflow is finished. + # + # The running workflow can be aborted via + # operations.cancel. + # This will cause any inflight jobs to be cancelled and workflow-owned + # clusters to be deleted. + # + # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + # Also see [Using + # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + # + # On successful completion, + # {::Google::Longrunning::Operation#response Operation.response} will be + # {::Google::Protobuf::Empty Empty}. + # + # @overload instantiate_workflow_template(request, options = nil) + # Pass arguments to `instantiate_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload instantiate_workflow_template(name: nil, version: nil, request_id: nil, parameters: nil) + # Pass arguments to `instantiate_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to instantiate. If specified, + # the workflow will be instantiated only if the current version of + # the workflow template has the supplied version. + # + # This option cannot be used to instantiate a previous version of + # workflow template. + # @param request_id [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @param parameters [::Hash{::String => ::String}] + # Optional. Map from parameter names to values that should be used for those + # parameters. Values may not exceed 1000 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new + # + # # Call the instantiate_workflow_template method. + # result = client.instantiate_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def instantiate_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.instantiate_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.instantiate_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.instantiate_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.instantiate_workflow_template request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Instantiates a template and begins execution. + # + # This method is equivalent to executing the sequence + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#create_workflow_template CreateWorkflowTemplate}, + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#instantiate_workflow_template InstantiateWorkflowTemplate}, + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#delete_workflow_template DeleteWorkflowTemplate}. + # + # The returned Operation can be used to track execution of + # workflow by polling + # operations.get. + # The Operation will complete when entire workflow is finished. + # + # The running workflow can be aborted via + # operations.cancel. + # This will cause any inflight jobs to be cancelled and workflow-owned + # clusters to be deleted. + # + # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be + # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + # Also see [Using + # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + # + # On successful completion, + # {::Google::Longrunning::Operation#response Operation.response} will be + # {::Google::Protobuf::Empty Empty}. + # + # @overload instantiate_inline_workflow_template(request, options = nil) + # Pass arguments to `instantiate_inline_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload instantiate_inline_workflow_template(parent: nil, template: nil, request_id: nil) + # Pass arguments to `instantiate_inline_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,instantiateinline`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.instantiateinline`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The workflow template to instantiate. + # @param request_id [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new + # + # # Call the instantiate_inline_workflow_template method. + # result = client.instantiate_inline_workflow_template request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def instantiate_inline_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.instantiate_inline_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.instantiate_inline_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.instantiate_inline_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.instantiate_inline_workflow_template request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates (replaces) workflow template. The updated template + # must contain version that matches the current server version. + # + # @overload update_workflow_template(request, options = nil) + # Pass arguments to `update_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_workflow_template(template: nil) + # Pass arguments to `update_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] + # Required. The updated workflow template. + # + # The `template.version` field must match the current version. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new + # + # # Call the update_workflow_template method. + # result = client.update_workflow_template request + # + # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p result + # + def update_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.update_workflow_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists workflows that match the specified filter in the request. + # + # @overload list_workflow_templates(request, options = nil) + # Pass arguments to `list_workflow_templates` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_workflow_templates(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workflow_templates` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,list`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.list`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of results to return in each response. + # @param page_token [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new + # + # # Call the list_workflow_templates method. + # result = client.list_workflow_templates request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. + # p item + # end + # + def list_workflow_templates request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_workflow_templates.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_workflow_templates.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workflow_templates.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.list_workflow_templates request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workflow_template_service_stub, :list_workflow_templates, "templates", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a workflow template. It does not cancel in-progress workflows. + # + # @overload delete_workflow_template(request, options = nil) + # Pass arguments to `delete_workflow_template` via a request object, either of type + # {::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_workflow_template(name: nil, version: nil) + # Pass arguments to `delete_workflow_template` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.delete`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @param version [::Integer] + # Optional. The version of workflow template to delete. If specified, + # will only delete the template if the current server version matches + # specified version. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dataproc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new + # + # # Call the delete_workflow_template method. + # result = client.delete_workflow_template request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_workflow_template request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_workflow_template.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_workflow_template.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workflow_template.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflow_template_service_stub.delete_workflow_template request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the WorkflowTemplateService REST API. + # + # This class represents the configuration for WorkflowTemplateService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_workflow_template to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_workflow_template.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_workflow_template.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the WorkflowTemplateService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow_template + ## + # RPC-specific configuration for `get_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow_template + ## + # RPC-specific configuration for `instantiate_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :instantiate_workflow_template + ## + # RPC-specific configuration for `instantiate_inline_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :instantiate_inline_workflow_template + ## + # RPC-specific configuration for `update_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow_template + ## + # RPC-specific configuration for `list_workflow_templates` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflow_templates + ## + # RPC-specific configuration for `delete_workflow_template` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow_template + + # @private + def initialize parent_rpcs = nil + create_workflow_template_config = parent_rpcs.create_workflow_template if parent_rpcs.respond_to? :create_workflow_template + @create_workflow_template = ::Gapic::Config::Method.new create_workflow_template_config + get_workflow_template_config = parent_rpcs.get_workflow_template if parent_rpcs.respond_to? :get_workflow_template + @get_workflow_template = ::Gapic::Config::Method.new get_workflow_template_config + instantiate_workflow_template_config = parent_rpcs.instantiate_workflow_template if parent_rpcs.respond_to? :instantiate_workflow_template + @instantiate_workflow_template = ::Gapic::Config::Method.new instantiate_workflow_template_config + instantiate_inline_workflow_template_config = parent_rpcs.instantiate_inline_workflow_template if parent_rpcs.respond_to? :instantiate_inline_workflow_template + @instantiate_inline_workflow_template = ::Gapic::Config::Method.new instantiate_inline_workflow_template_config + update_workflow_template_config = parent_rpcs.update_workflow_template if parent_rpcs.respond_to? :update_workflow_template + @update_workflow_template = ::Gapic::Config::Method.new update_workflow_template_config + list_workflow_templates_config = parent_rpcs.list_workflow_templates if parent_rpcs.respond_to? :list_workflow_templates + @list_workflow_templates = ::Gapic::Config::Method.new list_workflow_templates_config + delete_workflow_template_config = parent_rpcs.delete_workflow_template if parent_rpcs.respond_to? :delete_workflow_template + @delete_workflow_template = ::Gapic::Config::Method.new delete_workflow_template_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb new file mode 100644 index 000000000000..0c92606c8862 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb @@ -0,0 +1,929 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the WorkflowTemplateService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the WorkflowTemplateService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "dataproc.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb new file mode 100644 index 000000000000..4b2554f319a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb @@ -0,0 +1,539 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataproc/v1/workflow_templates_pb" + +module Google + module Cloud + module Dataproc + module V1 + module WorkflowTemplateService + module Rest + ## + # REST service stub for the WorkflowTemplateService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # A result object deserialized from the server's reply + def create_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # A result object deserialized from the server's reply + def get_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the instantiate_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def instantiate_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_instantiate_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the instantiate_inline_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def instantiate_inline_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_instantiate_inline_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # A result object deserialized from the server's reply + def update_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_workflow_templates REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse] + # A result object deserialized from the server's reply + def list_workflow_templates request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workflow_templates_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_workflow_template request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_template_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workflowTemplates", + body: "template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workflowTemplates", + body: "template", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the instantiate_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_instantiate_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:instantiate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:instantiate", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the instantiate_inline_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_instantiate_inline_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workflowTemplates:instantiateInline", + body: "template", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workflowTemplates:instantiateInline", + body: "template", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :put, + uri_template: "/v1/{template.name}", + body: "template", + matches: [ + ["template.name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :put, + uri_template: "/v1/{template.name}", + body: "template", + matches: [ + ["template.name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workflow_templates REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_workflow_templates_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workflowTemplates", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workflowTemplates", + matches: [ + ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workflow_template REST call + # + # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_workflow_template_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb new file mode 100644 index 000000000000..e104f64c2b4f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dataproc/v1/workflow_templates.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dataproc/v1/clusters_pb' +require 'google/cloud/dataproc/v1/jobs_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/dataproc/v1/workflow_templates.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/clusters.proto\x1a#google/cloud/dataproc/v1/jobs.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x82\x06\n\x10WorkflowTemplate\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x06labels\x18\x06 \x03(\x0b\x32\x36.google.cloud.dataproc.v1.WorkflowTemplate.LabelsEntryB\x03\xe0\x41\x01\x12K\n\tplacement\x18\x07 \x01(\x0b\x32\x33.google.cloud.dataproc.v1.WorkflowTemplatePlacementB\x03\xe0\x41\x02\x12\x37\n\x04jobs\x18\x08 \x03(\x0b\x32$.google.cloud.dataproc.v1.OrderedJobB\x03\xe0\x41\x02\x12\x44\n\nparameters\x18\t \x03(\x0b\x32+.google.cloud.dataproc.v1.TemplateParameterB\x03\xe0\x41\x01\x12\x33\n\x0b\x64\x61g_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xca\x01\xea\x41\xc6\x01\n(dataproc.googleapis.com/WorkflowTemplate\x12Iprojects/{project}/regions/{region}/workflowTemplates/{workflow_template}\x12Mprojects/{project}/locations/{location}/workflowTemplates/{workflow_template} \x01\"\xb4\x01\n\x19WorkflowTemplatePlacement\x12\x43\n\x0fmanaged_cluster\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.ManagedClusterH\x00\x12\x45\n\x10\x63luster_selector\x18\x02 \x01(\x0b\x32).google.cloud.dataproc.v1.ClusterSelectorH\x00\x42\x0b\n\tplacement\"\xe3\x01\n\x0eManagedCluster\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x02\x12I\n\x06labels\x18\x04 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.ManagedCluster.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb5\x01\n\x0f\x43lusterSelector\x12\x11\n\x04zone\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x0e\x63luster_labels\x18\x02 \x03(\x0b\x32<.google.cloud.dataproc.v1.ClusterSelector.ClusterLabelsEntryB\x03\xe0\x41\x02\x1a\x34\n\x12\x43lusterLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x06\n\nOrderedJob\x12\x14\n\x07step_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\nhadoop_job\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.HadoopJobB\x03\xe0\x41\x01H\x00\x12<\n\tspark_job\x18\x03 \x01(\x0b\x32\".google.cloud.dataproc.v1.SparkJobB\x03\xe0\x41\x01H\x00\x12@\n\x0bpyspark_job\x18\x04 \x01(\x0b\x32$.google.cloud.dataproc.v1.PySparkJobB\x03\xe0\x41\x01H\x00\x12:\n\x08hive_job\x18\x05 \x01(\x0b\x32!.google.cloud.dataproc.v1.HiveJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x07pig_job\x18\x06 \x01(\x0b\x32 .google.cloud.dataproc.v1.PigJobB\x03\xe0\x41\x01H\x00\x12?\n\x0bspark_r_job\x18\x0b \x01(\x0b\x32#.google.cloud.dataproc.v1.SparkRJobB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_sql_job\x18\x07 \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkSqlJobB\x03\xe0\x41\x01H\x00\x12>\n\npresto_job\x18\x0c \x01(\x0b\x32#.google.cloud.dataproc.v1.PrestoJobB\x03\xe0\x41\x01H\x00\x12\x45\n\x06labels\x18\x08 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.OrderedJob.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nscheduling\x18\t \x01(\x0b\x32\'.google.cloud.dataproc.v1.JobSchedulingB\x03\xe0\x41\x01\x12\"\n\x15prerequisite_step_ids\x18\n \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08job_type\"\x9d\x01\n\x11TemplateParameter\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ields\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x46\n\nvalidation\x18\x04 \x01(\x0b\x32-.google.cloud.dataproc.v1.ParameterValidationB\x03\xe0\x41\x01\"\xa1\x01\n\x13ParameterValidation\x12:\n\x05regex\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.RegexValidationH\x00\x12;\n\x06values\x18\x02 \x01(\x0b\x32).google.cloud.dataproc.v1.ValueValidationH\x00\x42\x11\n\x0fvalidation_type\"\'\n\x0fRegexValidation\x12\x14\n\x07regexes\x18\x01 \x03(\tB\x03\xe0\x41\x02\"&\n\x0fValueValidation\x12\x13\n\x06values\x18\x01 \x03(\tB\x03\xe0\x41\x02\"\xd4\x06\n\x10WorkflowMetadata\x12\x15\n\x08template\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12G\n\x0e\x63reate_cluster\x18\x03 \x01(\x0b\x32*.google.cloud.dataproc.v1.ClusterOperationB\x03\xe0\x41\x03\x12;\n\x05graph\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.WorkflowGraphB\x03\xe0\x41\x03\x12G\n\x0e\x64\x65lete_cluster\x18\x05 \x01(\x0b\x32*.google.cloud.dataproc.v1.ClusterOperationB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.WorkflowMetadata.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12N\n\nparameters\x18\x08 \x03(\x0b\x32:.google.cloud.dataproc.v1.WorkflowMetadata.ParametersEntry\x12\x33\n\nstart_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x33\n\x0b\x64\x61g_timeout\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x37\n\x0e\x64\x61g_start_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x61g_end_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\"T\n\x10\x43lusterOperation\x12\x19\n\x0coperation_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65rror\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x64one\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\"K\n\rWorkflowGraph\x12:\n\x05nodes\x18\x01 \x03(\x0b\x32&.google.cloud.dataproc.v1.WorkflowNodeB\x03\xe0\x41\x03\"\xa3\x02\n\x0cWorkflowNode\x12\x14\n\x07step_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15prerequisite_step_ids\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x13\n\x06job_id\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\x05 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.WorkflowNode.NodeStateB\x03\xe0\x41\x03\x12\x12\n\x05\x65rror\x18\x06 \x01(\tB\x03\xe0\x41\x03\"j\n\tNodeState\x12\x1a\n\x16NODE_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x42LOCKED\x10\x01\x12\x0c\n\x08RUNNABLE\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tCOMPLETED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\"\xa4\x01\n\x1d\x43reateWorkflowTemplateRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x41\n\x08template\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\"r\n\x1aGetWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xad\x02\n\"InstantiateWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\nparameters\x18\x06 \x03(\x0b\x32L.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.ParametersEntryB\x03\xe0\x41\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc8\x01\n(InstantiateInlineWorkflowTemplateRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x41\n\x08template\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x1dUpdateWorkflowTemplateRequest\x12\x41\n\x08template\x18\x01 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\"\x91\x01\n\x1cListWorkflowTemplatesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x1dListWorkflowTemplatesResponse\x12\x42\n\ttemplates\x18\x01 \x03(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"u\n\x1d\x44\x65leteWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x32\xe6\x10\n\x17WorkflowTemplateService\x12\x9b\x02\n\x16\x43reateWorkflowTemplate\x12\x37.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"\x9b\x01\xda\x41\x0fparent,template\x82\xd3\xe4\x93\x02\x82\x01\"5/v1/{parent=projects/*/locations/*}/workflowTemplates:\x08templateZ?\"3/v1/{parent=projects/*/regions/*}/workflowTemplates:\x08template\x12\xf4\x01\n\x13GetWorkflowTemplate\x12\x34.google.cloud.dataproc.v1.GetWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"{\xda\x41\x04name\x82\xd3\xe4\x93\x02n\x12\x35/v1/{name=projects/*/locations/*/workflowTemplates/*}Z5\x12\x33/v1/{name=projects/*/regions/*/workflowTemplates/*}\x12\xd5\x02\n\x1bInstantiateWorkflowTemplate\x12<.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\xca\x41)\n\x15google.protobuf.Empty\x12\x10WorkflowMetadata\xda\x41\x04name\xda\x41\x0fname,parameters\x82\xd3\xe4\x93\x02\x8c\x01\"A/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate:\x01*ZD\"?/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate:\x01*\x12\xf4\x02\n!InstantiateInlineWorkflowTemplate\x12\x42.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41)\n\x15google.protobuf.Empty\x12\x10WorkflowMetadata\xda\x41\x0fparent,template\x82\xd3\xe4\x93\x02\xa6\x01\"G/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline:\x08templateZQ\"E/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline:\x08template\x12\xa6\x02\n\x16UpdateWorkflowTemplate\x12\x37.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"\xa6\x01\xda\x41\x08template\x82\xd3\xe4\x93\x02\x94\x01\x1a>/v1/{template.name=projects/*/locations/*/workflowTemplates/*}:\x08templateZH\x1a] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb new file mode 100644 index 000000000000..96d21ebb27bf --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb @@ -0,0 +1,296 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # Describes an autoscaling policy for Dataproc cluster autoscaler. + # @!attribute [rw] id + # @return [::String] + # Required. The policy id. + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of between 3 and 50 characters. + # @!attribute [r] name + # @return [::String] + # Output only. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies`, the resource name of the + # policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies`, the resource name of the + # policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + # @!attribute [rw] basic_algorithm + # @return [::Google::Cloud::Dataproc::V1::BasicAutoscalingAlgorithm] + # @!attribute [rw] worker_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupAutoscalingPolicyConfig] + # Required. Describes how the autoscaler will operate for primary workers. + # @!attribute [rw] secondary_worker_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupAutoscalingPolicyConfig] + # Optional. Describes how the autoscaler will operate for secondary workers. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this autoscaling policy. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with an autoscaling policy. + class AutoscalingPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Basic algorithm for autoscaling. + # @!attribute [rw] yarn_config + # @return [::Google::Cloud::Dataproc::V1::BasicYarnAutoscalingConfig] + # Required. YARN autoscaling configuration. + # @!attribute [rw] cooldown_period + # @return [::Google::Protobuf::Duration] + # Optional. Duration between scaling events. A scaling period starts after + # the update operation from the previous event has completed. + # + # Bounds: [2m, 1d]. Default: 2m. + class BasicAutoscalingAlgorithm + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Basic autoscaling configurations for YARN. + # @!attribute [rw] graceful_decommission_timeout + # @return [::Google::Protobuf::Duration] + # Required. Timeout for YARN graceful decommissioning of Node Managers. + # Specifies the duration to wait for jobs to complete before forcefully + # removing workers (and potentially interrupting jobs). Only applicable to + # downscaling operations. + # + # Bounds: [0s, 1d]. + # @!attribute [rw] scale_up_factor + # @return [::Float] + # Required. Fraction of average YARN pending memory in the last cooldown + # period for which to add workers. A scale-up factor of 1.0 will result in + # scaling up so that there is no pending memory remaining after the update + # (more aggressive scaling). A scale-up factor closer to 0 will result in a + # smaller magnitude of scaling up (less aggressive scaling). See [How + # autoscaling + # works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) + # for more information. + # + # Bounds: [0.0, 1.0]. + # @!attribute [rw] scale_down_factor + # @return [::Float] + # Required. Fraction of average YARN pending memory in the last cooldown + # period for which to remove workers. A scale-down factor of 1 will result in + # scaling down so that there is no available memory remaining after the + # update (more aggressive scaling). A scale-down factor of 0 disables + # removing workers, which can be beneficial for autoscaling a single job. + # See [How autoscaling + # works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) + # for more information. + # + # Bounds: [0.0, 1.0]. + # @!attribute [rw] scale_up_min_worker_fraction + # @return [::Float] + # Optional. Minimum scale-up threshold as a fraction of total cluster size + # before scaling occurs. For example, in a 20-worker cluster, a threshold of + # 0.1 means the autoscaler must recommend at least a 2-worker scale-up for + # the cluster to scale. A threshold of 0 means the autoscaler will scale up + # on any recommended change. + # + # Bounds: [0.0, 1.0]. Default: 0.0. + # @!attribute [rw] scale_down_min_worker_fraction + # @return [::Float] + # Optional. Minimum scale-down threshold as a fraction of total cluster size + # before scaling occurs. For example, in a 20-worker cluster, a threshold of + # 0.1 means the autoscaler must recommend at least a 2 worker scale-down for + # the cluster to scale. A threshold of 0 means the autoscaler will scale down + # on any recommended change. + # + # Bounds: [0.0, 1.0]. Default: 0.0. + class BasicYarnAutoscalingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for the size bounds of an instance group, including its + # proportional size to other groups. + # @!attribute [rw] min_instances + # @return [::Integer] + # Optional. Minimum number of instances for this group. + # + # Primary workers - Bounds: [2, max_instances]. Default: 2. + # Secondary workers - Bounds: [0, max_instances]. Default: 0. + # @!attribute [rw] max_instances + # @return [::Integer] + # Required. Maximum number of instances for this group. Required for primary + # workers. Note that by default, clusters will not use secondary workers. + # Required for secondary workers if the minimum secondary instances is set. + # + # Primary workers - Bounds: [min_instances, ). + # Secondary workers - Bounds: [min_instances, ). Default: 0. + # @!attribute [rw] weight + # @return [::Integer] + # Optional. Weight for the instance group, which is used to determine the + # fraction of total workers in the cluster from this instance group. + # For example, if primary workers have weight 2, and secondary workers have + # weight 1, the cluster will have approximately 2 primary workers for each + # secondary worker. + # + # The cluster may not reach the specified balance if constrained + # by min/max bounds or other autoscaling settings. For example, if + # `max_instances` for secondary workers is 0, then only primary workers will + # be added. The cluster can also be out of balance when created. + # + # If weight is not set on any instance group, the cluster will default to + # equal weight for all groups: the cluster will attempt to maintain an equal + # number of workers in each group within the configured size bounds for each + # group. If weight is set for one group only, the cluster will default to + # zero weight on the unset group. For example if weight is set only on + # primary workers, the cluster will use primary workers only and no + # secondary workers. + class InstanceGroupAutoscalingPolicyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to create an autoscaling policy. + # @!attribute [rw] parent + # @return [::String] + # Required. The "resource name" of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.create`, the resource name + # of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.autoscalingPolicies.create`, the resource name + # of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @!attribute [rw] policy + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # Required. The autoscaling policy to create. + class CreateAutoscalingPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to fetch an autoscaling policy. + # @!attribute [rw] name + # @return [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.get`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + class GetAutoscalingPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update an autoscaling policy. + # @!attribute [rw] policy + # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] + # Required. The updated autoscaling policy. + class UpdateAutoscalingPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete an autoscaling policy. + # + # Autoscaling policies in use by one or more clusters will not be deleted. + # @!attribute [rw] name + # @return [::String] + # Required. The "resource name" of the autoscaling policy, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + # + # * For `projects.locations.autoscalingPolicies.delete`, the resource name + # of the policy has the following format: + # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + class DeleteAutoscalingPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list autoscaling policies in a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The "resource name" of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.autoscalingPolicies.list`, the resource name + # of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.autoscalingPolicies.list`, the resource name + # of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in each response. + # Must be less than or equal to 1000. Defaults to 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + class ListAutoscalingPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response to a request to list autoscaling policies in a project. + # @!attribute [r] policies + # @return [::Array<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] + # Output only. Autoscaling policies list. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. This token is included in the response if there are more + # results to fetch. + class ListAutoscalingPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb new file mode 100644 index 000000000000..b018cccf8325 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb @@ -0,0 +1,367 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # A request to create a batch workload. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this batch will be created. + # @!attribute [rw] batch + # @return [::Google::Cloud::Dataproc::V1::Batch] + # Required. The batch to create. + # @!attribute [rw] batch_id + # @return [::String] + # Optional. The ID to use for the batch, which will become the final + # component of the batch's resource name. + # + # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + # with the same request_id, the second request is ignored and the + # Operation that corresponds to the first Batch created and stored + # in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class CreateBatchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get the resource representation for a batch workload. + # @!attribute [rw] name + # @return [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + class GetBatchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list batch workloads in a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of batches. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of batches to return in each response. + # The service may return fewer than this value. + # The default page size is 20; the maximum page size is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token received from a previous `ListBatches` call. + # Provide this token to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter for the batches to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each batch resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND/OR). + # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + # + # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + # filters for batches in state RUNNING that were created before 2023-01-01 + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparisons. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Field(s) on which to sort the list of batches. + # + # Currently the only supported sort orders are unspecified (empty) and + # `create_time desc` to sort by most recently created batches first. + # + # See https://google.aip.dev/132#ordering for more details. + class ListBatchesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of batch workloads. + # @!attribute [rw] batches + # @return [::Array<::Google::Cloud::Dataproc::V1::Batch>] + # The batches from the specified collection. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListBatchesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a batch workload. + # @!attribute [rw] name + # @return [::String] + # Required. The fully qualified name of the batch to retrieve + # in the format + # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + class DeleteBatchRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A representation of a batch workload in the service. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the batch. + # @!attribute [r] uuid + # @return [::String] + # Output only. A batch UUID (Unique Universal Identifier). The service + # generates this value when it creates the batch. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the batch was created. + # @!attribute [rw] pyspark_batch + # @return [::Google::Cloud::Dataproc::V1::PySparkBatch] + # Optional. PySpark batch config. + # @!attribute [rw] spark_batch + # @return [::Google::Cloud::Dataproc::V1::SparkBatch] + # Optional. Spark batch config. + # @!attribute [rw] spark_r_batch + # @return [::Google::Cloud::Dataproc::V1::SparkRBatch] + # Optional. SparkR batch config. + # @!attribute [rw] spark_sql_batch + # @return [::Google::Cloud::Dataproc::V1::SparkSqlBatch] + # Optional. SparkSql batch config. + # @!attribute [r] runtime_info + # @return [::Google::Cloud::Dataproc::V1::RuntimeInfo] + # Output only. Runtime information about batch execution. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::Batch::State] + # Output only. The state of the batch. + # @!attribute [r] state_message + # @return [::String] + # Output only. Batch state details, such as a failure + # description if the state is `FAILED`. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the batch entered a current state. + # @!attribute [r] creator + # @return [::String] + # Output only. The email address of the user who created the batch. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this batch. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with a batch. + # @!attribute [rw] runtime_config + # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] + # Optional. Runtime configuration for the batch execution. + # @!attribute [rw] environment_config + # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] + # Optional. Environment configuration for the batch execution. + # @!attribute [r] operation + # @return [::String] + # Output only. The resource name of the operation associated with this batch. + # @!attribute [r] state_history + # @return [::Array<::Google::Cloud::Dataproc::V1::Batch::StateHistory>] + # Output only. Historical state information for the batch. + class Batch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Historical state information. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::Batch::State] + # Output only. The state of the batch at this point in history. + # @!attribute [r] state_message + # @return [::String] + # Output only. Details about the state at this point in history. + # @!attribute [r] state_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the batch entered the historical state. + class StateHistory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The batch state. + module State + # The batch state is unknown. + STATE_UNSPECIFIED = 0 + + # The batch is created before running. + PENDING = 1 + + # The batch is running. + RUNNING = 2 + + # The batch is cancelling. + CANCELLING = 3 + + # The batch cancellation was successful. + CANCELLED = 4 + + # The batch completed successfully. + SUCCEEDED = 5 + + # The batch is no longer running due to an error. + FAILED = 6 + end + end + + # A configuration for running an + # [Apache + # PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html) + # batch workload. + # @!attribute [rw] main_python_file_uri + # @return [::String] + # Required. The HCFS URI of the main Python file to use as the Spark driver. + # Must be a .py file. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not include arguments + # that can be set as batch properties, such as `--conf`, since a collision + # can occur that causes an incorrect batch submission. + # @!attribute [rw] python_file_uris + # @return [::Array<::String>] + # Optional. HCFS file URIs of Python files to pass to the PySpark + # framework. Supported file types: `.py`, `.egg`, and `.zip`. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the classpath of the + # Spark driver and tasks. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + class PySparkBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A configuration for running an [Apache Spark](https://spark.apache.org/) + # batch workload. + # @!attribute [rw] main_jar_file_uri + # @return [::String] + # Optional. The HCFS URI of the jar file that contains the main class. + # @!attribute [rw] main_class + # @return [::String] + # Optional. The name of the driver main class. The jar file that contains + # the class must be in the classpath or specified in `jar_file_uris`. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not include arguments + # that can be set as batch properties, such as `--conf`, since a collision + # can occur that causes an incorrect batch submission. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the classpath of the + # Spark driver and tasks. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + class SparkBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A configuration for running an + # [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) + # batch workload. + # @!attribute [rw] main_r_file_uri + # @return [::String] + # Required. The HCFS URI of the main R file to use as the driver. + # Must be a `.R` or `.r` file. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the Spark driver. Do not include + # arguments that can be set as batch properties, such as `--conf`, since a + # collision can occur that causes an incorrect batch submission. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + class SparkRBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A configuration for running + # [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch + # workload. + # @!attribute [rw] query_file_uri + # @return [::String] + # Required. The HCFS URI of the script that contains Spark SQL queries to + # execute. + # @!attribute [rw] query_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Mapping of query variable names to values (equivalent to the + # Spark SQL command: `SET name="value";`). + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + class SparkSqlBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class QueryVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb new file mode 100644 index 000000000000..4c884f6fe466 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb @@ -0,0 +1,1627 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # Describes the identifying information, config, and status of + # a Dataproc cluster + # @!attribute [rw] project_id + # @return [::String] + # Required. The Google Cloud Platform project ID that the cluster belongs to. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name, which must be unique within a project. + # The name must start with a lowercase letter, and can contain + # up to 51 lowercase letters, numbers, and hyphens. It cannot end + # with a hyphen. The name of a deleted cluster can be reused. + # @!attribute [rw] config + # @return [::Google::Cloud::Dataproc::V1::ClusterConfig] + # Optional. The cluster config for a cluster of Compute Engine Instances. + # Note that Dataproc may set default values, and values may change + # when clusters are updated. + # + # Exactly one of ClusterConfig or VirtualClusterConfig must be specified. + # @!attribute [rw] virtual_cluster_config + # @return [::Google::Cloud::Dataproc::V1::VirtualClusterConfig] + # Optional. The virtual cluster config is used when creating a Dataproc + # cluster that does not directly control the underlying compute resources, + # for example, when creating a [Dataproc-on-GKE + # cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). + # Dataproc may set default values, and values may change when + # clusters are updated. Exactly one of + # {::Google::Cloud::Dataproc::V1::Cluster#config config} or + # {::Google::Cloud::Dataproc::V1::Cluster#virtual_cluster_config virtual_cluster_config} + # must be specified. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this cluster. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with a cluster. + # @!attribute [r] status + # @return [::Google::Cloud::Dataproc::V1::ClusterStatus] + # Output only. Cluster status. + # @!attribute [r] status_history + # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterStatus>] + # Output only. The previous cluster status. + # @!attribute [r] cluster_uuid + # @return [::String] + # Output only. A cluster UUID (Unique Universal Identifier). Dataproc + # generates this value when it creates the cluster. + # @!attribute [r] metrics + # @return [::Google::Cloud::Dataproc::V1::ClusterMetrics] + # Output only. Contains cluster daemon metrics such as HDFS and YARN stats. + # + # **Beta Feature**: This report is available for testing purposes only. It + # may be changed before final release. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The cluster config. + # @!attribute [rw] config_bucket + # @return [::String] + # Optional. A Cloud Storage bucket used to stage job + # dependencies, config files, and job driver console output. + # If you do not specify a staging bucket, Cloud + # Dataproc will determine a Cloud Storage location (US, + # ASIA, or EU) for your cluster's staging bucket according to the + # Compute Engine zone where your cluster is deployed, and then create + # and manage this project-level, per-location 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.** + # @!attribute [rw] temp_bucket + # @return [::String] + # 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.** + # @!attribute [rw] gce_cluster_config + # @return [::Google::Cloud::Dataproc::V1::GceClusterConfig] + # Optional. The shared Compute Engine config settings for + # all instances in a cluster. + # @!attribute [rw] master_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] + # Optional. The Compute Engine config settings for + # the cluster's master instance. + # @!attribute [rw] worker_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] + # Optional. The Compute Engine config settings for + # the cluster's worker instances. + # @!attribute [rw] secondary_worker_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] + # Optional. The Compute Engine config settings for + # a cluster's secondary worker instances + # @!attribute [rw] software_config + # @return [::Google::Cloud::Dataproc::V1::SoftwareConfig] + # Optional. The config settings for cluster software. + # @!attribute [rw] initialization_actions + # @return [::Array<::Google::Cloud::Dataproc::V1::NodeInitializationAction>] + # Optional. Commands to execute on each node after config is + # completed. By default, executables are run on master and all worker nodes. + # You can test a node's `role` metadata to run an executable on + # a master or worker node, as shown below using `curl` (you can also use + # `wget`): + # + # ROLE=$(curl -H Metadata-Flavor:Google + # http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + # if [[ "${ROLE}" == 'Master' ]]; then + # ... master specific actions ... + # else + # ... worker specific actions ... + # fi + # @!attribute [rw] encryption_config + # @return [::Google::Cloud::Dataproc::V1::EncryptionConfig] + # Optional. Encryption settings for the cluster. + # @!attribute [rw] autoscaling_config + # @return [::Google::Cloud::Dataproc::V1::AutoscalingConfig] + # Optional. Autoscaling config for the policy associated with the cluster. + # Cluster does not autoscale if this field is unset. + # @!attribute [rw] security_config + # @return [::Google::Cloud::Dataproc::V1::SecurityConfig] + # Optional. Security settings for the cluster. + # @!attribute [rw] lifecycle_config + # @return [::Google::Cloud::Dataproc::V1::LifecycleConfig] + # Optional. Lifecycle setting for the cluster. + # @!attribute [rw] endpoint_config + # @return [::Google::Cloud::Dataproc::V1::EndpointConfig] + # Optional. Port/endpoint configuration for this cluster + # @!attribute [rw] metastore_config + # @return [::Google::Cloud::Dataproc::V1::MetastoreConfig] + # Optional. Metastore configuration. + # @!attribute [rw] dataproc_metric_config + # @return [::Google::Cloud::Dataproc::V1::DataprocMetricConfig] + # Optional. The config for Dataproc metrics. + # @!attribute [rw] auxiliary_node_groups + # @return [::Array<::Google::Cloud::Dataproc::V1::AuxiliaryNodeGroup>] + # Optional. The node group settings. + class ClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Dataproc cluster config for a cluster that does not directly control the + # underlying compute resources, such as a [Dataproc-on-GKE + # cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). + # @!attribute [rw] staging_bucket + # @return [::String] + # Optional. A Cloud Storage bucket used to stage job + # dependencies, config files, and job driver console output. + # If you do not specify a staging bucket, Cloud + # Dataproc will determine a Cloud Storage location (US, + # ASIA, or EU) for your cluster's staging bucket according to the + # Compute Engine zone where your cluster is deployed, and then create + # and manage this project-level, per-location 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.** + # @!attribute [rw] kubernetes_cluster_config + # @return [::Google::Cloud::Dataproc::V1::KubernetesClusterConfig] + # Required. The configuration for running the Dataproc cluster on + # Kubernetes. + # @!attribute [rw] auxiliary_services_config + # @return [::Google::Cloud::Dataproc::V1::AuxiliaryServicesConfig] + # Optional. Configuration of auxiliary services used by this cluster. + class VirtualClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Auxiliary services configuration for a Cluster. + # @!attribute [rw] metastore_config + # @return [::Google::Cloud::Dataproc::V1::MetastoreConfig] + # Optional. The Hive Metastore configuration for this workload. + # @!attribute [rw] spark_history_server_config + # @return [::Google::Cloud::Dataproc::V1::SparkHistoryServerConfig] + # Optional. The Spark History Server configuration for the workload. + class AuxiliaryServicesConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Endpoint config for this cluster + # @!attribute [r] http_ports + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. The map of port descriptions to URLs. Will only be populated + # if enable_http_port_access is true. + # @!attribute [rw] enable_http_port_access + # @return [::Boolean] + # Optional. If true, enable http access to specific ports on the cluster + # from external sources. Defaults to false. + class EndpointConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class HttpPortsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Autoscaling Policy config associated with the cluster. + # @!attribute [rw] policy_uri + # @return [::String] + # Optional. The autoscaling policy used by the cluster. + # + # Only resource names including projectid and location (region) are valid. + # Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` + # * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` + # + # Note that the policy must be in the same project and Dataproc region. + class AutoscalingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Encryption settings for the cluster. + # @!attribute [rw] gce_pd_kms_key_name + # @return [::String] + # Optional. The Cloud KMS key name to use for PD disk encryption for all + # instances in the cluster. + class EncryptionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Common config settings for resources of Compute Engine cluster + # instances, applicable to all instances in the cluster. + # @!attribute [rw] zone_uri + # @return [::String] + # Optional. The Compute Engine zone where the Dataproc cluster will be + # located. If omitted, the service will pick a zone in the cluster's Compute + # Engine region. On a get request, zone will always be present. + # + # A full URL, partial URI, or short name are valid. Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]` + # * `projects/[project_id]/zones/[zone]` + # * `[zone]` + # @!attribute [rw] network_uri + # @return [::String] + # Optional. The Compute Engine network to be used for machine + # communications. Cannot be specified with subnetwork_uri. If neither + # `network_uri` nor `subnetwork_uri` is specified, the "default" network of + # the project is used, if it exists. Cannot be a "Custom Subnet Network" (see + # [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for + # more information). + # + # A full URL, partial URI, or short name are valid. Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + # * `projects/[project_id]/global/networks/default` + # * `default` + # @!attribute [rw] subnetwork_uri + # @return [::String] + # Optional. The Compute Engine subnetwork to be used for machine + # communications. Cannot be specified with network_uri. + # + # A full URL, partial URI, or short name are valid. Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/[region]/subnetworks/sub0` + # * `projects/[project_id]/regions/[region]/subnetworks/sub0` + # * `sub0` + # @!attribute [rw] internal_ip_only + # @return [::Boolean] + # Optional. If true, all instances in the cluster will only have internal IP + # addresses. By default, clusters are not restricted to internal IP + # addresses, and will have ephemeral external IP addresses assigned to each + # instance. This `internal_ip_only` restriction can only be enabled for + # subnetwork enabled networks, and all off-cluster dependencies must be + # configured to be accessible without external IP addresses. + # @!attribute [rw] private_ipv6_google_access + # @return [::Google::Cloud::Dataproc::V1::GceClusterConfig::PrivateIpv6GoogleAccess] + # Optional. The type of IPv6 access for a cluster. + # @!attribute [rw] service_account + # @return [::String] + # Optional. The [Dataproc service + # account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) + # (also see [VM Data Plane + # identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) + # used by Dataproc cluster VM instances to access Google Cloud Platform + # services. + # + # If not specified, the + # [Compute Engine default service + # account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + # is used. + # @!attribute [rw] service_account_scopes + # @return [::Array<::String>] + # Optional. The URIs of service account scopes to be included in + # Compute Engine instances. The following base set of scopes is always + # included: + # + # * https://www.googleapis.com/auth/cloud.useraccounts.readonly + # * https://www.googleapis.com/auth/devstorage.read_write + # * https://www.googleapis.com/auth/logging.write + # + # If no scopes are specified, the following defaults are also provided: + # + # * https://www.googleapis.com/auth/bigquery + # * https://www.googleapis.com/auth/bigtable.admin.table + # * https://www.googleapis.com/auth/bigtable.data + # * https://www.googleapis.com/auth/devstorage.full_control + # @!attribute [rw] tags + # @return [::Array<::String>] + # The Compute Engine tags to add to all instances (see [Tagging + # instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The Compute Engine metadata entries to add to all instances (see + # [Project and instance + # metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + # @!attribute [rw] reservation_affinity + # @return [::Google::Cloud::Dataproc::V1::ReservationAffinity] + # Optional. Reservation Affinity for consuming Zonal reservation. + # @!attribute [rw] node_group_affinity + # @return [::Google::Cloud::Dataproc::V1::NodeGroupAffinity] + # Optional. Node Group Affinity for sole-tenant clusters. + # @!attribute [rw] shielded_instance_config + # @return [::Google::Cloud::Dataproc::V1::ShieldedInstanceConfig] + # Optional. Shielded Instance Config for clusters using [Compute Engine + # Shielded + # VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). + # @!attribute [rw] confidential_instance_config + # @return [::Google::Cloud::Dataproc::V1::ConfidentialInstanceConfig] + # Optional. Confidential Instance Config for clusters using [Confidential + # VMs](https://cloud.google.com/compute/confidential-vm/docs). + class GceClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes + # can communicate with Google Services through gRPC over IPv6. + # These values are directly mapped to corresponding values in the + # [Compute Engine Instance + # fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + module PrivateIpv6GoogleAccess + # If unspecified, Compute Engine default behavior will apply, which + # is the same as + # {::Google::Cloud::Dataproc::V1::GceClusterConfig::PrivateIpv6GoogleAccess::INHERIT_FROM_SUBNETWORK INHERIT_FROM_SUBNETWORK}. + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0 + + # Private access to and from Google Services configuration + # inherited from the subnetwork configuration. This is the + # default Compute Engine behavior. + INHERIT_FROM_SUBNETWORK = 1 + + # Enables outbound private IPv6 access to Google Services from the Dataproc + # cluster. + OUTBOUND = 2 + + # Enables bidirectional private IPv6 access between Google Services and the + # Dataproc cluster. + BIDIRECTIONAL = 3 + end + end + + # Node Group Affinity for clusters using sole-tenant node groups. + # **The Dataproc `NodeGroupAffinity` resource is not related to the + # Dataproc {::Google::Cloud::Dataproc::V1::NodeGroup NodeGroup} resource.** + # @!attribute [rw] node_group_uri + # @return [::String] + # Required. The URI of a + # sole-tenant [node group + # resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) + # that the cluster will be created on. + # + # A full URL, partial URI, or node group name are valid. Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` + # * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` + # * `node-group-1` + class NodeGroupAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Shielded Instance Config for clusters using [Compute Engine Shielded + # VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). + # @!attribute [rw] enable_secure_boot + # @return [::Boolean] + # Optional. Defines whether instances have Secure Boot enabled. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Defines whether instances have the vTPM enabled. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Defines whether instances have integrity monitoring enabled. + class ShieldedInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Confidential Instance Config for clusters using [Confidential + # VMs](https://cloud.google.com/compute/confidential-vm/docs) + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Optional. Defines whether the instance should have confidential compute + # enabled. + class ConfidentialInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The config settings for Compute Engine resources in + # an instance group, such as a master or worker group. + # @!attribute [rw] num_instances + # @return [::Integer] + # Optional. The number of VM instances in the instance group. + # For [HA + # cluster](/dataproc/docs/concepts/configuring-clusters/high-availability) + # [master_config](#FIELDS.master_config) groups, **must be set to 3**. + # For standard cluster [master_config](#FIELDS.master_config) groups, + # **must be set to 1**. + # @!attribute [r] instance_names + # @return [::Array<::String>] + # Output only. The list of instance names. Dataproc derives the names + # from `cluster_name`, `num_instances`, and the instance group. + # @!attribute [r] instance_references + # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceReference>] + # Output only. List of references to Compute Engine instances. + # @!attribute [rw] image_uri + # @return [::String] + # Optional. The Compute Engine image resource used for cluster instances. + # + # The URI can represent an image or image family. + # + # Image examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/[image-id]` + # * `projects/[project_id]/global/images/[image-id]` + # * `image-id` + # + # Image family examples. Dataproc will use the most recent + # image from the family: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/family/[custom-image-family-name]` + # * `projects/[project_id]/global/images/family/[custom-image-family-name]` + # + # If the URI is unspecified, it will be inferred from + # `SoftwareConfig.image_version` or the system default. + # @!attribute [rw] machine_type_uri + # @return [::String] + # Optional. The Compute Engine machine type used for cluster instances. + # + # A full URL, partial URI, or short name are valid. Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` + # * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` + # * `n1-standard-2` + # + # **Auto Zone Exception**: If you are using the Dataproc + # [Auto Zone + # Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) + # feature, you must use the short name of the machine type + # resource, for example, `n1-standard-2`. + # @!attribute [rw] disk_config + # @return [::Google::Cloud::Dataproc::V1::DiskConfig] + # Optional. Disk option config settings. + # @!attribute [r] is_preemptible + # @return [::Boolean] + # Output only. Specifies that this instance group contains preemptible + # instances. + # @!attribute [rw] preemptibility + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig::Preemptibility] + # Optional. Specifies the preemptibility of the instance group. + # + # The default value for master and worker groups is + # `NON_PREEMPTIBLE`. This default cannot be changed. + # + # The default value for secondary instances is + # `PREEMPTIBLE`. + # @!attribute [r] managed_group_config + # @return [::Google::Cloud::Dataproc::V1::ManagedGroupConfig] + # Output only. The config for Compute Engine Instance Group + # Manager that manages this group. + # This is only used for preemptible instance groups. + # @!attribute [rw] accelerators + # @return [::Array<::Google::Cloud::Dataproc::V1::AcceleratorConfig>] + # Optional. The Compute Engine accelerator configuration for these + # instances. + # @!attribute [rw] min_cpu_platform + # @return [::String] + # Optional. Specifies the minimum cpu platform for the Instance Group. + # See [Dataproc -> Minimum CPU + # Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). + # @!attribute [rw] min_num_instances + # @return [::Integer] + # Optional. The minimum number of primary worker instances to create. + # If `min_num_instances` is set, cluster creation will succeed if + # the number of primary workers created is at least equal to the + # `min_num_instances` number. + # + # Example: Cluster creation request with `num_instances` = `5` and + # `min_num_instances` = `3`: + # + # * If 4 VMs are created and 1 instance fails, + # the failed VM is deleted. The cluster is + # resized to 4 instances and placed in a `RUNNING` state. + # * If 2 instances are created and 3 instances fail, + # the cluster in placed in an `ERROR` state. The failed VMs + # are not deleted. + # @!attribute [rw] instance_flexibility_policy + # @return [::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy] + # Optional. Instance flexibility Policy allowing a mixture of VM shapes and + # provisioning models. + # @!attribute [rw] startup_config + # @return [::Google::Cloud::Dataproc::V1::StartupConfig] + # Optional. Configuration to handle the startup of instances during cluster + # create and update process. + class InstanceGroupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Controls the use of preemptible instances within the group. + module Preemptibility + # Preemptibility is unspecified, the system will choose the + # appropriate setting for each instance group. + PREEMPTIBILITY_UNSPECIFIED = 0 + + # Instances are non-preemptible. + # + # This option is allowed for all instance groups and is the only valid + # value for Master and Worker instance groups. + NON_PREEMPTIBLE = 1 + + # Instances are [preemptible] + # (https://cloud.google.com/compute/docs/instances/preemptible). + # + # This option is allowed only for [secondary worker] + # (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) + # groups. + PREEMPTIBLE = 2 + + # Instances are [Spot VMs] + # (https://cloud.google.com/compute/docs/instances/spot). + # + # This option is allowed only for [secondary worker] + # (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) + # groups. Spot VMs are the latest version of [preemptible VMs] + # (https://cloud.google.com/compute/docs/instances/preemptible), and + # provide additional features. + SPOT = 3 + end + end + + # Configuration to handle the startup of instances during cluster create and + # update process. + # @!attribute [rw] required_registration_fraction + # @return [::Float] + # Optional. The config setting to enable cluster creation/ updation to be + # successful only after required_registration_fraction of instances are up + # and running. This configuration is applicable to only secondary workers for + # now. The cluster will fail if required_registration_fraction of instances + # are not available. This will include instance creation, agent registration, + # and service registration (if enabled). + class StartupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reference to a Compute Engine instance. + # @!attribute [rw] instance_name + # @return [::String] + # The user-friendly name of the Compute Engine instance. + # @!attribute [rw] instance_id + # @return [::String] + # The unique identifier of the Compute Engine instance. + # @!attribute [rw] public_key + # @return [::String] + # The public RSA key used for sharing data with this instance. + # @!attribute [rw] public_ecies_key + # @return [::String] + # The public ECIES key used for sharing data with this instance. + class InstanceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the resources used to actively manage an instance group. + # @!attribute [r] instance_template_name + # @return [::String] + # Output only. The name of the Instance Template used for the Managed + # Instance Group. + # @!attribute [r] instance_group_manager_name + # @return [::String] + # Output only. The name of the Instance Group Manager for this group. + # @!attribute [r] instance_group_manager_uri + # @return [::String] + # Output only. The partial URI to the instance group manager for this group. + # E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm. + class ManagedGroupConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instance flexibility Policy allowing a mixture of VM shapes and provisioning + # models. + # @!attribute [rw] instance_selection_list + # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy::InstanceSelection>] + # Optional. List of instance selection options that the group will use when + # creating new VMs. + # @!attribute [r] instance_selection_results + # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy::InstanceSelectionResult>] + # Output only. A list of instance selection results in the group. + class InstanceFlexibilityPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines machines types and a rank to which the machines types belong. + # @!attribute [rw] machine_types + # @return [::Array<::String>] + # Optional. Full machine-type names, e.g. "n1-standard-16". + # @!attribute [rw] rank + # @return [::Integer] + # Optional. Preference of this instance selection. Lower number means + # higher preference. Dataproc will first try to create a VM based on the + # machine-type with priority rank and fallback to next rank based on + # availability. Machine types and instance selections with the same + # priority have the same preference. + class InstanceSelection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines a mapping from machine types to the number of VMs that are created + # with each machine type. + # @!attribute [r] machine_type + # @return [::String] + # Output only. Full machine-type names, e.g. "n1-standard-16". + # @!attribute [r] vm_count + # @return [::Integer] + # Output only. Number of VM provisioned with the machine_type. + class InstanceSelectionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specifies the type and number of accelerator cards attached to the instances + # of an instance. See [GPUs on Compute + # Engine](https://cloud.google.com/compute/docs/gpus/). + # @!attribute [rw] accelerator_type_uri + # @return [::String] + # Full URL, partial URI, or short name of the accelerator type resource to + # expose to this instance. See + # [Compute Engine + # AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes). + # + # Examples: + # + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80` + # * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80` + # * `nvidia-tesla-k80` + # + # **Auto Zone Exception**: If you are using the Dataproc + # [Auto Zone + # Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) + # feature, you must use the short name of the accelerator type + # resource, for example, `nvidia-tesla-k80`. + # @!attribute [rw] accelerator_count + # @return [::Integer] + # The number of the accelerator cards of this type exposed to this instance. + class AcceleratorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the config of disk options for a group of VM instances. + # @!attribute [rw] boot_disk_type + # @return [::String] + # Optional. Type of the boot disk (default is "pd-standard"). + # Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive), + # "pd-ssd" (Persistent Disk Solid State Drive), + # or "pd-standard" (Persistent Disk Hard Disk Drive). + # See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types). + # @!attribute [rw] boot_disk_size_gb + # @return [::Integer] + # Optional. Size in GB of the boot disk (default is 500GB). + # @!attribute [rw] num_local_ssds + # @return [::Integer] + # Optional. Number of attached SSDs, from 0 to 8 (default is 0). + # If SSDs are not attached, the boot disk is used to store runtime logs and + # [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. + # If one or more SSDs are attached, this runtime bulk + # data is spread across them, and the boot disk contains only basic + # config and installed binaries. + # + # Note: Local SSD options may vary by machine type and number of vCPUs + # selected. + # @!attribute [rw] local_ssd_interface + # @return [::String] + # Optional. Interface type of local SSDs (default is "scsi"). + # Valid values: "scsi" (Small Computer System Interface), + # "nvme" (Non-Volatile Memory Express). + # See [local SSD + # performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance). + class DiskConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Node group identification and configuration information. + # @!attribute [rw] node_group + # @return [::Google::Cloud::Dataproc::V1::NodeGroup] + # Required. Node group configuration. + # @!attribute [rw] node_group_id + # @return [::String] + # Optional. A node group ID. Generated if not specified. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of from 3 to 33 characters. + class AuxiliaryNodeGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Dataproc Node Group. + # **The Dataproc `NodeGroup` resource is not related to the + # Dataproc {::Google::Cloud::Dataproc::V1::NodeGroupAffinity NodeGroupAffinity} + # resource.** + # @!attribute [rw] name + # @return [::String] + # The Node group [resource name](https://aip.dev/122). + # @!attribute [rw] roles + # @return [::Array<::Google::Cloud::Dataproc::V1::NodeGroup::Role>] + # Required. Node group roles. + # @!attribute [rw] node_group_config + # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] + # Optional. The node group instance group configuration. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Node group labels. + # + # * Label **keys** must consist of from 1 to 63 characters and conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # * Label **values** can be empty. If specified, they must consist of from + # 1 to 63 characters and conform to [RFC 1035] + # (https://www.ietf.org/rfc/rfc1035.txt). + # * The node group must have no more than 32 labels. + class NodeGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Node pool roles. + module Role + # Required unspecified role. + ROLE_UNSPECIFIED = 0 + + # Job drivers run on the node pool. + DRIVER = 1 + end + end + + # Specifies an executable to run on a fully configured node and a + # timeout period for executable completion. + # @!attribute [rw] executable_file + # @return [::String] + # Required. Cloud Storage URI of executable file. + # @!attribute [rw] execution_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Amount of time executable has to complete. Default is + # 10 minutes (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Cluster creation fails with an explanatory error message (the + # name of the executable that caused the error and the exceeded timeout + # period) if the executable is not completed at end of the timeout period. + class NodeInitializationAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The status of a cluster and its instances. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::ClusterStatus::State] + # Output only. The cluster's state. + # @!attribute [r] detail + # @return [::String] + # Optional. Output only. Details of cluster's state. + # @!attribute [r] state_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this state was entered (see JSON representation of + # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # @!attribute [r] substate + # @return [::Google::Cloud::Dataproc::V1::ClusterStatus::Substate] + # Output only. Additional state information that includes + # status reported by the agent. + class ClusterStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The cluster state. + module State + # The cluster state is unknown. + UNKNOWN = 0 + + # The cluster is being created and set up. It is not ready for use. + CREATING = 1 + + # The cluster is currently running and healthy. It is ready for use. + # + # **Note:** The cluster state changes from "creating" to "running" status + # after the master node(s), first two primary worker nodes (and the last + # primary worker node if primary workers > 2) are running. + RUNNING = 2 + + # The cluster encountered an error. It is not ready for use. + ERROR = 3 + + # The cluster has encountered an error while being updated. Jobs can + # be submitted to the cluster, but the cluster cannot be updated. + ERROR_DUE_TO_UPDATE = 9 + + # The cluster is being deleted. It cannot be used. + DELETING = 4 + + # The cluster is being updated. It continues to accept and process jobs. + UPDATING = 5 + + # The cluster is being stopped. It cannot be used. + STOPPING = 6 + + # The cluster is currently stopped. It is not ready for use. + STOPPED = 7 + + # The cluster is being started. It is not ready for use. + STARTING = 8 + + # The cluster is being repaired. It is not ready for use. + REPAIRING = 10 + end + + # The cluster substate. + module Substate + # The cluster substate is unknown. + UNSPECIFIED = 0 + + # The cluster is known to be in an unhealthy state + # (for example, critical daemons are not running or HDFS capacity is + # exhausted). + # + # Applies to RUNNING state. + UNHEALTHY = 1 + + # The agent-reported status is out of date (may occur if + # Dataproc loses communication with Agent). + # + # Applies to RUNNING state. + STALE_STATUS = 2 + end + end + + # Security related configuration, including encryption, Kerberos, etc. + # @!attribute [rw] kerberos_config + # @return [::Google::Cloud::Dataproc::V1::KerberosConfig] + # Optional. Kerberos related configuration. + # @!attribute [rw] identity_config + # @return [::Google::Cloud::Dataproc::V1::IdentityConfig] + # Optional. Identity related configuration, including service account based + # secure multi-tenancy user mappings. + class SecurityConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies Kerberos related configuration. + # @!attribute [rw] enable_kerberos + # @return [::Boolean] + # Optional. Flag to indicate whether to Kerberize the cluster (default: + # false). Set this field to true to enable Kerberos on a cluster. + # @!attribute [rw] root_principal_password_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the root + # principal password. + # @!attribute [rw] kms_key_uri + # @return [::String] + # Optional. The uri of the KMS key used to encrypt various sensitive + # files. + # @!attribute [rw] keystore_uri + # @return [::String] + # Optional. The Cloud Storage URI of the keystore file used for SSL + # encryption. If not provided, Dataproc will provide a self-signed + # certificate. + # @!attribute [rw] truststore_uri + # @return [::String] + # Optional. The Cloud Storage URI of the truststore file used for SSL + # encryption. If not provided, Dataproc will provide a self-signed + # certificate. + # @!attribute [rw] keystore_password_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the + # password to the user provided keystore. For the self-signed certificate, + # this password is generated by Dataproc. + # @!attribute [rw] key_password_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the + # password to the user provided key. For the self-signed certificate, this + # password is generated by Dataproc. + # @!attribute [rw] truststore_password_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the + # password to the user provided truststore. For the self-signed certificate, + # this password is generated by Dataproc. + # @!attribute [rw] cross_realm_trust_realm + # @return [::String] + # Optional. The remote realm the Dataproc on-cluster KDC will trust, should + # the user enable cross realm trust. + # @!attribute [rw] cross_realm_trust_kdc + # @return [::String] + # Optional. The KDC (IP or hostname) for the remote trusted realm in a cross + # realm trust relationship. + # @!attribute [rw] cross_realm_trust_admin_server + # @return [::String] + # Optional. The admin server (IP or hostname) for the remote trusted realm in + # a cross realm trust relationship. + # @!attribute [rw] cross_realm_trust_shared_password_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the + # shared password between the on-cluster Kerberos realm and the remote + # trusted realm, in a cross realm trust relationship. + # @!attribute [rw] kdc_db_key_uri + # @return [::String] + # Optional. The Cloud Storage URI of a KMS encrypted file containing the + # master key of the KDC database. + # @!attribute [rw] tgt_lifetime_hours + # @return [::Integer] + # Optional. The lifetime of the ticket granting ticket, in hours. + # If not specified, or user specifies 0, then default value 10 + # will be used. + # @!attribute [rw] realm + # @return [::String] + # Optional. The name of the on-cluster Kerberos realm. + # If not specified, the uppercased domain of hostnames will be the realm. + class KerberosConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identity related configuration, including service account based + # secure multi-tenancy user mappings. + # @!attribute [rw] user_service_account_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Required. Map of user to service account. + class IdentityConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserServiceAccountMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specifies the selection and config of software inside the cluster. + # @!attribute [rw] image_version + # @return [::String] + # Optional. The version of software inside the cluster. It must be one of the + # supported [Dataproc + # Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions), + # such as "1.2" (including a subminor version, such as "1.2.29"), or the + # ["preview" + # version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). + # If unspecified, it defaults to the latest Debian version. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The properties to set on daemon config files. + # + # Property keys are specified in `prefix:property` format, for example + # `core:hadoop.tmp.dir`. The following are supported prefixes + # and their mappings: + # + # * capacity-scheduler: `capacity-scheduler.xml` + # * core: `core-site.xml` + # * distcp: `distcp-default.xml` + # * hdfs: `hdfs-site.xml` + # * hive: `hive-site.xml` + # * mapred: `mapred-site.xml` + # * pig: `pig.properties` + # * spark: `spark-defaults.conf` + # * yarn: `yarn-site.xml` + # + # For more information, see [Cluster + # properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). + # @!attribute [rw] optional_components + # @return [::Array<::Google::Cloud::Dataproc::V1::Component>] + # Optional. The set of components to activate on the cluster. + class SoftwareConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specifies the cluster auto-delete schedule configuration. + # @!attribute [rw] idle_delete_ttl + # @return [::Google::Protobuf::Duration] + # Optional. The duration to keep the cluster alive while idling (when no jobs + # are running). Passing this threshold will cause the cluster to be + # deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON + # representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # @!attribute [rw] auto_delete_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time when cluster will be auto-deleted (see JSON + # representation of + # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # @!attribute [rw] auto_delete_ttl + # @return [::Google::Protobuf::Duration] + # Optional. The lifetime duration of cluster. The cluster will be + # auto-deleted at the end of this period. Minimum value is 10 minutes; + # maximum value is 14 days (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # @!attribute [r] idle_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when cluster became idle (most recent job finished) + # and became eligible for deletion due to idleness (see JSON representation + # of + # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + class LifecycleConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies a Metastore configuration. + # @!attribute [rw] dataproc_metastore_service + # @return [::String] + # Required. Resource name of an existing Dataproc Metastore service. + # + # Example: + # + # * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]` + class MetastoreConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains cluster daemon metrics, such as HDFS and YARN stats. + # + # **Beta Feature**: This report is available for testing purposes only. It may + # be changed before final release. + # @!attribute [rw] hdfs_metrics + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # The HDFS metrics. + # @!attribute [rw] yarn_metrics + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # YARN metrics. + class ClusterMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class HdfsMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class YarnMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Dataproc metric config. + # @!attribute [rw] metrics + # @return [::Array<::Google::Cloud::Dataproc::V1::DataprocMetricConfig::Metric>] + # Required. Metrics sources to enable. + class DataprocMetricConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A Dataproc custom metric. + # @!attribute [rw] metric_source + # @return [::Google::Cloud::Dataproc::V1::DataprocMetricConfig::MetricSource] + # Required. A standard set of metrics is collected unless `metricOverrides` + # are specified for the metric source (see [Custom metrics] + # (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) + # for more information). + # @!attribute [rw] metric_overrides + # @return [::Array<::String>] + # Optional. Specify one or more [Custom metrics] + # (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) + # to collect for the metric course (for the `SPARK` metric source (any + # [Spark metric] + # (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be + # specified). + # + # Provide metrics in the following format: + # METRIC_SOURCE:INSTANCE:GROUP:METRIC + # Use camelcase as appropriate. + # + # Examples: + # + # ``` + # yarn:ResourceManager:QueueMetrics:AppsCompleted + # spark:driver:DAGScheduler:job.allJobs + # sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed + # hiveserver2:JVM:Memory:NonHeapMemoryUsage.used + # ``` + # + # Notes: + # + # * Only the specified overridden metrics are collected for the + # metric source. For example, if one or more `spark:executive` metrics + # are listed as metric overrides, other `SPARK` metrics are not + # collected. The collection of the metrics for other enabled custom + # metric sources is unaffected. For example, if both `SPARK` andd `YARN` + # metric sources are enabled, and overrides are provided for Spark + # metrics only, all YARN metrics are collected. + class Metric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A source for the collection of Dataproc custom metrics (see [Custom + # metrics] + # (https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics)). + module MetricSource + # Required unspecified metric source. + METRIC_SOURCE_UNSPECIFIED = 0 + + # Monitoring agent metrics. If this source is enabled, + # Dataproc enables the monitoring agent in Compute Engine, + # and collects monitoring agent metrics, which are published + # with an `agent.googleapis.com` prefix. + MONITORING_AGENT_DEFAULTS = 1 + + # HDFS metric source. + HDFS = 2 + + # Spark metric source. + SPARK = 3 + + # YARN metric source. + YARN = 4 + + # Spark History Server metric source. + SPARK_HISTORY_SERVER = 5 + + # Hiveserver2 metric source. + HIVESERVER2 = 6 + + # hivemetastore metric source + HIVEMETASTORE = 7 + end + end + + # A request to create a cluster. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster + # @return [::Google::Cloud::Dataproc::V1::Cluster] + # Required. The cluster to create. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @!attribute [rw] action_on_failed_primary_workers + # @return [::Google::Cloud::Dataproc::V1::FailureAction] + # Optional. Failure action when primary worker creation fails. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update a cluster. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + # @!attribute [rw] cluster + # @return [::Google::Cloud::Dataproc::V1::Cluster] + # Required. The changes to the cluster. + # @!attribute [rw] graceful_decommission_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Timeout for graceful YARN decommissioning. Graceful + # decommissioning allows removing nodes from the cluster without + # interrupting jobs in progress. Timeout specifies how long to wait for jobs + # in progress to finish before forcefully removing nodes (and potentially + # interrupting jobs). Default timeout is 0 (for forceful decommission), and + # the maximum allowed timeout is 1 day. (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the path, relative to `Cluster`, of + # the field to update. For example, to change the number of workers + # in a cluster to 5, the `update_mask` parameter would be + # specified as `config.worker_config.num_instances`, + # and the `PATCH` request body would specify the new value, as follows: + # + # { + # "config":{ + # "workerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Similarly, to change the number of preemptible workers in a cluster to 5, + # the `update_mask` parameter would be + # `config.secondary_worker_config.num_instances`, and the `PATCH` request + # body would be set as follows: + # + # { + # "config":{ + # "secondaryWorkerConfig":{ + # "numInstances":"5" + # } + # } + # } + # Note: Currently, only the following fields can be updated: + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + # + #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + # change autoscaling policies
+ # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to stop a cluster. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + # @!attribute [rw] cluster_uuid + # @return [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class StopClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to start a cluster. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project the + # cluster belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + # @!attribute [rw] cluster_uuid + # @return [::String] + # Optional. Specifying the `cluster_uuid` means the RPC will fail + # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class StartClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a cluster. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + # @!attribute [rw] cluster_uuid + # @return [::String] + # Optional. Specifying the `cluster_uuid` means the RPC should fail + # (with error NOT_FOUND) if cluster with specified UUID does not exist. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server + # receives two + # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get the resource representation for a cluster in a project. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list the clusters in a project. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter constraining the clusters to list. Filters are + # case-sensitive and have the following syntax: + # + # field = value [AND [field = value]] ... + # + # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + # and `[KEY]` is a label key. **value** can be `*` to match all values. + # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` + # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` + # contains the `DELETING` and `ERROR` states. + # `clusterName` is the name of the cluster provided at creation time. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND clusterName = mycluster + # AND labels.env = staging AND labels.starred = * + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The standard List page size. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The standard List page token. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The list of all clusters in a project. + # @!attribute [r] clusters + # @return [::Array<::Google::Cloud::Dataproc::V1::Cluster>] + # Output only. The clusters in the project. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. This token is included in the response if there are more + # results to fetch. To fetch additional results, provide this value as the + # `page_token` in a subsequent `ListClustersRequest`. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to collect cluster diagnostic information. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the cluster + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name. + # @!attribute [rw] tarball_gcs_dir + # @return [::String] + # Optional. The output Cloud Storage directory for the diagnostic + # tarball. If not specified, a task-specific directory in the cluster's + # staging bucket will be used. + # @!attribute [rw] tarball_access + # @return [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket + # @!attribute [rw] diagnosis_interval + # @return [::Google::Type::Interval] + # Optional. Time interval in which diagnosis should be carried out on the + # cluster. + # @!attribute [rw] jobs + # @return [::Array<::String>] + # Optional. Specifies a list of jobs on which diagnosis is to be performed. + # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} + # @!attribute [rw] yarn_application_ids + # @return [::Array<::String>] + # Optional. Specifies a list of yarn applications on which diagnosis is to be + # performed. + class DiagnoseClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines who has access to the diagnostic tarball + module TarballAccess + # Tarball Access unspecified. Falls back to default access of the bucket + TARBALL_ACCESS_UNSPECIFIED = 0 + + # Google Cloud Support group has read access to the + # diagnostic tarball + GOOGLE_CLOUD_SUPPORT = 1 + + # Google Cloud Dataproc Diagnose service account has read access to the + # diagnostic tarball + GOOGLE_DATAPROC_DIAGNOSE = 2 + end + end + + # The location of diagnostic output. + # @!attribute [r] output_uri + # @return [::String] + # Output only. The Cloud Storage URI of the diagnostic output. + # The output report is a plain text file with a summary of collected + # diagnostics. + class DiagnoseClusterResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Reservation Affinity for consuming Zonal reservation. + # @!attribute [rw] consume_reservation_type + # @return [::Google::Cloud::Dataproc::V1::ReservationAffinity::Type] + # Optional. Type of reservation to consume + # @!attribute [rw] key + # @return [::String] + # Optional. Corresponds to the label key of reservation resource. + # @!attribute [rw] values + # @return [::Array<::String>] + # Optional. Corresponds to the label values of reservation resource. + class ReservationAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates whether to consume capacity from an reservation or not. + module Type + TYPE_UNSPECIFIED = 0 + + # Do not consume from any allocated capacity. + NO_RESERVATION = 1 + + # Consume any reservation available. + ANY_RESERVATION = 2 + + # Must consume from a specific reservation. Must specify key value fields + # for specifying the reservations. + SPECIFIC_RESERVATION = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb new file mode 100644 index 000000000000..09667b29f9ef --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb @@ -0,0 +1,1073 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # The runtime logging config of the job. + # @!attribute [rw] driver_log_levels + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataproc::V1::LoggingConfig::Level}] + # The per-package log levels for the driver. This may include + # "root" package name to configure rootLogger. + # Examples: + # - 'com.google = FATAL' + # - 'root = INFO' + # - 'org.apache = DEBUG' + class LoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig::Level] + class DriverLogLevelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Log4j level for job execution. When running an + # [Apache Hive](https://hive.apache.org/) job, Cloud + # Dataproc configures the Hive client to an equivalent verbosity level. + module Level + # Level is unspecified. Use default level for log4j. + LEVEL_UNSPECIFIED = 0 + + # Use ALL level for log4j. + ALL = 1 + + # Use TRACE level for log4j. + TRACE = 2 + + # Use DEBUG level for log4j. + DEBUG = 3 + + # Use INFO level for log4j. + INFO = 4 + + # Use WARN level for log4j. + WARN = 5 + + # Use ERROR level for log4j. + ERROR = 6 + + # Use FATAL level for log4j. + FATAL = 7 + + # Turn off log4j. + OFF = 8 + end + end + + # A Dataproc job for running + # [Apache Hadoop + # MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) + # jobs on [Apache Hadoop + # YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). + # @!attribute [rw] main_jar_file_uri + # @return [::String] + # The HCFS URI of the jar file containing the main class. + # Examples: + # 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + # 'hdfs:/tmp/test-samples/custom-wordcount.jar' + # 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + # @!attribute [rw] main_class + # @return [::String] + # The name of the driver's main class. The jar file containing the class + # must be in the default CLASSPATH or specified in `jar_file_uris`. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not + # include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as + # job properties, since a collision may occur that causes an incorrect job + # submission. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. Jar file URIs to add to the CLASSPATHs of the + # Hadoop driver and tasks. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied + # to the working directory of Hadoop drivers and distributed tasks. Useful + # for naively parallel tasks. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted in the working directory of + # Hadoop drivers and tasks. Supported file types: + # .jar, .tar, .tar.gz, .tgz, or .zip. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure Hadoop. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and + # classes in user code. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class HadoopJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running [Apache Spark](https://spark.apache.org/) + # applications on YARN. + # @!attribute [rw] main_jar_file_uri + # @return [::String] + # The HCFS URI of the jar file that contains the main class. + # @!attribute [rw] main_class + # @return [::String] + # The name of the driver's main class. The jar file that contains the class + # must be in the default CLASSPATH or specified in `jar_file_uris`. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not include arguments, + # such as `--conf`, that can be set as job properties, since a collision may + # occur that causes an incorrect job submission. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the CLASSPATHs of the + # Spark driver and tasks. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. Useful for naively parallel tasks. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # .jar, .tar, .tar.gz, .tgz, and .zip. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure Spark. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in + # /etc/spark/conf/spark-defaults.conf and classes in user code. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class SparkJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running + # [Apache + # PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) + # applications on YARN. + # @!attribute [rw] main_python_file_uri + # @return [::String] + # Required. The HCFS URI of the main Python file to use as the driver. Must + # be a .py file. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not include arguments, + # such as `--conf`, that can be set as job properties, since a collision may + # occur that causes an incorrect job submission. + # @!attribute [rw] python_file_uris + # @return [::Array<::String>] + # Optional. HCFS file URIs of Python files to pass to the PySpark + # framework. Supported file types: .py, .egg, and .zip. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the CLASSPATHs of the + # Python driver and tasks. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. Useful for naively parallel tasks. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # .jar, .tar, .tar.gz, .tgz, and .zip. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure PySpark. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in + # /etc/spark/conf/spark-defaults.conf and classes in user code. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class PySparkJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A list of queries to run on a cluster. + # @!attribute [rw] queries + # @return [::Array<::String>] + # Required. The queries to execute. You do not need to end a query expression + # with a semicolon. Multiple queries can be specified in one + # string by separating each with a semicolon. Here is an example of a + # Dataproc API snippet that uses a QueryList to specify a HiveJob: + # + # "hiveJob": { + # "queryList": { + # "queries": [ + # "query1", + # "query2", + # "query3;query4", + # ] + # } + # } + class QueryList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Dataproc job for running [Apache Hive](https://hive.apache.org/) + # queries on YARN. + # @!attribute [rw] query_file_uri + # @return [::String] + # The HCFS URI of the script that contains Hive queries. + # @!attribute [rw] query_list + # @return [::Google::Cloud::Dataproc::V1::QueryList] + # A list of queries. + # @!attribute [rw] continue_on_failure + # @return [::Boolean] + # Optional. Whether to continue executing queries if a query fails. + # The default value is `false`. Setting to `true` can be useful when + # executing independent parallel queries. + # @!attribute [rw] script_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Mapping of query variable names to values (equivalent to the + # Hive command: `SET name="value";`). + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names and values, used to configure Hive. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, + # /etc/hive/conf/hive-site.xml, and classes in user code. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the CLASSPATH of the + # Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes + # and UDFs. + class HiveJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ScriptVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running [Apache Spark + # SQL](https://spark.apache.org/sql/) queries. + # @!attribute [rw] query_file_uri + # @return [::String] + # The HCFS URI of the script that contains SQL queries. + # @!attribute [rw] query_list + # @return [::Google::Cloud::Dataproc::V1::QueryList] + # A list of queries. + # @!attribute [rw] script_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Mapping of query variable names to values (equivalent to the + # Spark SQL command: SET `name="value";`). + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure + # Spark SQL's SparkConf. Properties that conflict with values set by the + # Dataproc API may be overwritten. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class SparkSqlJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ScriptVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running [Apache Pig](https://pig.apache.org/) + # queries on YARN. + # @!attribute [rw] query_file_uri + # @return [::String] + # The HCFS URI of the script that contains the Pig queries. + # @!attribute [rw] query_list + # @return [::Google::Cloud::Dataproc::V1::QueryList] + # A list of queries. + # @!attribute [rw] continue_on_failure + # @return [::Boolean] + # Optional. Whether to continue executing queries if a query fails. + # The default value is `false`. Setting to `true` can be useful when + # executing independent parallel queries. + # @!attribute [rw] script_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Mapping of query variable names to values (equivalent to the Pig + # command: `name=[value]`). + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure Pig. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, + # /etc/pig/conf/pig.properties, and classes in user code. + # @!attribute [rw] jar_file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of jar files to add to the CLASSPATH of + # the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class PigJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ScriptVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running + # [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) + # applications on YARN. + # @!attribute [rw] main_r_file_uri + # @return [::String] + # Required. The HCFS URI of the main R file to use as the driver. + # Must be a .R file. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. The arguments to pass to the driver. Do not include arguments, + # such as `--conf`, that can be set as job properties, since a collision may + # occur that causes an incorrect job submission. + # @!attribute [rw] file_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of files to be placed in the working directory of + # each executor. Useful for naively parallel tasks. + # @!attribute [rw] archive_uris + # @return [::Array<::String>] + # Optional. HCFS URIs of archives to be extracted into the working directory + # of each executor. Supported file types: + # .jar, .tar, .tar.gz, .tgz, and .zip. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, used to configure SparkR. + # Properties that conflict with values set by the Dataproc API may be + # overwritten. Can include properties set in + # /etc/spark/conf/spark-defaults.conf and classes in user code. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class SparkRJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running [Presto](https://prestosql.io/) queries. + # **IMPORTANT**: The [Dataproc Presto Optional + # Component](https://cloud.google.com/dataproc/docs/concepts/components/presto) + # must be enabled when the cluster is created to submit a Presto job to the + # cluster. + # @!attribute [rw] query_file_uri + # @return [::String] + # The HCFS URI of the script that contains SQL queries. + # @!attribute [rw] query_list + # @return [::Google::Cloud::Dataproc::V1::QueryList] + # A list of queries. + # @!attribute [rw] continue_on_failure + # @return [::Boolean] + # Optional. Whether to continue executing queries if a query fails. + # The default value is `false`. Setting to `true` can be useful when + # executing independent parallel queries. + # @!attribute [rw] output_format + # @return [::String] + # Optional. The format in which query output will be displayed. See the + # Presto documentation for supported output formats + # @!attribute [rw] client_tags + # @return [::Array<::String>] + # Optional. Presto client tags to attach to this query + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values. Used to set Presto + # [session properties](https://prestodb.io/docs/current/sql/set-session.html) + # Equivalent to using the --session flag in the Presto CLI + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class PrestoJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Dataproc job for running [Trino](https://trino.io/) queries. + # **IMPORTANT**: The [Dataproc Trino Optional + # Component](https://cloud.google.com/dataproc/docs/concepts/components/trino) + # must be enabled when the cluster is created to submit a Trino job to the + # cluster. + # @!attribute [rw] query_file_uri + # @return [::String] + # The HCFS URI of the script that contains SQL queries. + # @!attribute [rw] query_list + # @return [::Google::Cloud::Dataproc::V1::QueryList] + # A list of queries. + # @!attribute [rw] continue_on_failure + # @return [::Boolean] + # Optional. Whether to continue executing queries if a query fails. + # The default value is `false`. Setting to `true` can be useful when + # executing independent parallel queries. + # @!attribute [rw] output_format + # @return [::String] + # Optional. The format in which query output will be displayed. See the + # Trino documentation for supported output formats + # @!attribute [rw] client_tags + # @return [::Array<::String>] + # Optional. Trino client tags to attach to this query + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values. Used to set Trino + # [session properties](https://trino.io/docs/current/sql/set-session.html) + # Equivalent to using the --session flag in the Trino CLI + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] + # Optional. The runtime log config for job execution. + class TrinoJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Dataproc job config. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The name of the cluster where the job will be submitted. + # @!attribute [r] cluster_uuid + # @return [::String] + # Output only. A cluster UUID generated by the Dataproc service when + # the job is submitted. + # @!attribute [rw] cluster_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Cluster labels to identify a cluster where the job will be + # submitted. + class JobPlacement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ClusterLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Dataproc job status. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::JobStatus::State] + # Output only. A state message specifying the overall job state. + # @!attribute [r] details + # @return [::String] + # Optional. Output only. Job state details, such as an error + # description if the state is ERROR. + # @!attribute [r] state_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when this state was entered. + # @!attribute [r] substate + # @return [::Google::Cloud::Dataproc::V1::JobStatus::Substate] + # Output only. Additional state information, which includes + # status reported by the agent. + class JobStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The job state. + module State + # The job state is unknown. + STATE_UNSPECIFIED = 0 + + # The job is pending; it has been submitted, but is not yet running. + PENDING = 1 + + # Job has been received by the service and completed initial setup; + # it will soon be submitted to the cluster. + SETUP_DONE = 8 + + # The job is running on the cluster. + RUNNING = 2 + + # A CancelJob request has been received, but is pending. + CANCEL_PENDING = 3 + + # Transient in-flight resources have been canceled, and the request to + # cancel the running job has been issued to the cluster. + CANCEL_STARTED = 7 + + # The job cancellation was successful. + CANCELLED = 4 + + # The job has completed successfully. + DONE = 5 + + # The job has completed, but encountered an error. + ERROR = 6 + + # Job attempt has failed. The detail field contains failure details for + # this attempt. + # + # Applies to restartable jobs only. + ATTEMPT_FAILURE = 9 + end + + # The job substate. + module Substate + # The job substate is unknown. + UNSPECIFIED = 0 + + # The Job is submitted to the agent. + # + # Applies to RUNNING state. + SUBMITTED = 1 + + # The Job has been received and is awaiting execution (it may be waiting + # for a condition to be met). See the "details" field for the reason for + # the delay. + # + # Applies to RUNNING state. + QUEUED = 2 + + # The agent-reported status is out of date, which may be caused by a + # loss of communication between the agent and Dataproc. If the + # agent does not send a timely update, the job will fail. + # + # Applies to RUNNING state. + STALE_STATUS = 3 + end + end + + # Encapsulates the full scoping used to reference a job. + # @!attribute [rw] project_id + # @return [::String] + # Optional. The ID of the Google Cloud Platform project that the job belongs + # to. If specified, must match the request project ID. + # @!attribute [rw] job_id + # @return [::String] + # Optional. The job ID, which must be unique within the project. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), or hyphens (-). The maximum length is 100 characters. + # + # If not specified by the caller, the job ID will be provided by the server. + class JobReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A YARN application created by a job. Application information is a subset of + # org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto. + # + # **Beta Feature**: This report is available for testing purposes only. It may + # be changed before final release. + # @!attribute [rw] name + # @return [::String] + # Required. The application name. + # @!attribute [rw] state + # @return [::Google::Cloud::Dataproc::V1::YarnApplication::State] + # Required. The application state. + # @!attribute [rw] progress + # @return [::Float] + # Required. The numerical progress of the application, from 1 to 100. + # @!attribute [rw] tracking_url + # @return [::String] + # Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or + # TimelineServer that provides application-specific information. The URL uses + # the internal hostname, and requires a proxy server for resolution and, + # possibly, access. + class YarnApplication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The application state, corresponding to + # YarnProtos.YarnApplicationStateProto. + module State + # Status is unspecified. + STATE_UNSPECIFIED = 0 + + # Status is NEW. + NEW = 1 + + # Status is NEW_SAVING. + NEW_SAVING = 2 + + # Status is SUBMITTED. + SUBMITTED = 3 + + # Status is ACCEPTED. + ACCEPTED = 4 + + # Status is RUNNING. + RUNNING = 5 + + # Status is FINISHED. + FINISHED = 6 + + # Status is FAILED. + FAILED = 7 + + # Status is KILLED. + KILLED = 8 + end + end + + # A Dataproc job resource. + # @!attribute [rw] reference + # @return [::Google::Cloud::Dataproc::V1::JobReference] + # Optional. The fully qualified reference to the job, which can be used to + # obtain the equivalent REST path of the job resource. If this property + # is not specified when a job is created, the server generates a + # job_id. + # @!attribute [rw] placement + # @return [::Google::Cloud::Dataproc::V1::JobPlacement] + # Required. Job information, including how, when, and where to + # run the job. + # @!attribute [rw] hadoop_job + # @return [::Google::Cloud::Dataproc::V1::HadoopJob] + # Optional. Job is a Hadoop job. + # @!attribute [rw] spark_job + # @return [::Google::Cloud::Dataproc::V1::SparkJob] + # Optional. Job is a Spark job. + # @!attribute [rw] pyspark_job + # @return [::Google::Cloud::Dataproc::V1::PySparkJob] + # Optional. Job is a PySpark job. + # @!attribute [rw] hive_job + # @return [::Google::Cloud::Dataproc::V1::HiveJob] + # Optional. Job is a Hive job. + # @!attribute [rw] pig_job + # @return [::Google::Cloud::Dataproc::V1::PigJob] + # Optional. Job is a Pig job. + # @!attribute [rw] spark_r_job + # @return [::Google::Cloud::Dataproc::V1::SparkRJob] + # Optional. Job is a SparkR job. + # @!attribute [rw] spark_sql_job + # @return [::Google::Cloud::Dataproc::V1::SparkSqlJob] + # Optional. Job is a SparkSql job. + # @!attribute [rw] presto_job + # @return [::Google::Cloud::Dataproc::V1::PrestoJob] + # Optional. Job is a Presto job. + # @!attribute [rw] trino_job + # @return [::Google::Cloud::Dataproc::V1::TrinoJob] + # Optional. Job is a Trino job. + # @!attribute [r] status + # @return [::Google::Cloud::Dataproc::V1::JobStatus] + # Output only. The job status. Additional application-specific + # status information may be contained in the type_job + # and yarn_applications fields. + # @!attribute [r] status_history + # @return [::Array<::Google::Cloud::Dataproc::V1::JobStatus>] + # Output only. The previous job status. + # @!attribute [r] yarn_applications + # @return [::Array<::Google::Cloud::Dataproc::V1::YarnApplication>] + # Output only. The collection of YARN applications spun up by this job. + # + # **Beta** Feature: This report is available for testing purposes only. It + # may be changed before final release. + # @!attribute [r] driver_output_resource_uri + # @return [::String] + # Output only. A URI pointing to the location of the stdout of the job's + # driver program. + # @!attribute [r] driver_control_files_uri + # @return [::String] + # Output only. If present, the location of miscellaneous control files + # which may be used as part of job setup and handling. If not present, + # control files may be placed in the same location as `driver_output_uri`. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this job. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with a job. + # @!attribute [rw] scheduling + # @return [::Google::Cloud::Dataproc::V1::JobScheduling] + # Optional. Job scheduling configuration. + # @!attribute [r] job_uuid + # @return [::String] + # Output only. A UUID that uniquely identifies a job within the project + # over time. This is in contrast to a user-settable reference.job_id that + # may be reused over time. + # @!attribute [r] done + # @return [::Boolean] + # Output only. Indicates whether the job is completed. If the value is + # `false`, the job is still in progress. If `true`, the job is completed, and + # `status.state` field will indicate if it was successful, failed, + # or cancelled. + # @!attribute [rw] driver_scheduling_config + # @return [::Google::Cloud::Dataproc::V1::DriverSchedulingConfig] + # Optional. Driver scheduling configuration. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Driver scheduling configuration. + # @!attribute [rw] memory_mb + # @return [::Integer] + # Required. The amount of memory in MB the driver is requesting. + # @!attribute [rw] vcores + # @return [::Integer] + # Required. The number of vCPUs the driver is requesting. + class DriverSchedulingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job scheduling options. + # @!attribute [rw] max_failures_per_hour + # @return [::Integer] + # Optional. Maximum number of times per hour a driver may be restarted as + # a result of driver exiting with non-zero code before job is + # reported failed. + # + # A job may be reported as thrashing if the driver exits with a non-zero code + # four times within a 10-minute window. + # + # Maximum value is 10. + # + # **Note:** This restartable job option is not supported in Dataproc + # [workflow templates] + # (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). + # @!attribute [rw] max_failures_total + # @return [::Integer] + # Optional. Maximum total number of times a driver may be restarted as a + # result of the driver exiting with a non-zero code. After the maximum number + # is reached, the job will be reported as failed. + # + # Maximum value is 240. + # + # **Note:** Currently, this restartable job option is + # not supported in Dataproc + # [workflow + # templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). + class JobScheduling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to submit a job. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] job + # @return [::Google::Cloud::Dataproc::V1::Job] + # Required. The job resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique id used to identify the request. If the server + # receives two + # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + # with the same id, then the second request will be ignored and the + # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class SubmitJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job Operation metadata. + # @!attribute [r] job_id + # @return [::String] + # Output only. The job id. + # @!attribute [r] status + # @return [::Google::Cloud::Dataproc::V1::JobStatus] + # Output only. Most recent job status. + # @!attribute [r] operation_type + # @return [::String] + # Output only. Operation type. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Job submission time. + class JobMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get the resource representation for a job in a project. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] job_id + # @return [::String] + # Required. The job ID. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list jobs in a project. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The number of results to return in each response. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + # @!attribute [rw] cluster_name + # @return [::String] + # Optional. If set, the returned jobs list includes only jobs that were + # submitted to the named cluster. + # @!attribute [rw] job_state_matcher + # @return [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] + # Optional. Specifies enumerated categories of jobs to list. + # (default = match ALL jobs). + # + # If `filter` is provided, `jobStateMatcher` will be ignored. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter constraining the jobs to list. Filters are + # case-sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + # + # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + # key. **value** can be `*` to match all values. + # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + # Only the logical `AND` operator is supported; space-separated items are + # treated as having an implicit `AND` operator. + # + # Example filter: + # + # status.state = ACTIVE AND labels.env = staging AND labels.starred = * + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A matcher that specifies categories of job states. + module JobStateMatcher + # Match all jobs, regardless of state. + ALL = 0 + + # Only match jobs in non-terminal states: PENDING, RUNNING, or + # CANCEL_PENDING. + ACTIVE = 1 + + # Only match jobs in terminal states: CANCELLED, DONE, or ERROR. + NON_ACTIVE = 2 + end + end + + # A request to update a job. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] job_id + # @return [::String] + # Required. The job ID. + # @!attribute [rw] job + # @return [::Google::Cloud::Dataproc::V1::Job] + # Required. The changes to the job. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the path, relative to Job, of + # the field to update. For example, to update the labels of a Job the + # update_mask parameter would be specified as + # labels, and the `PATCH` request body would specify the new + # value. Note: Currently, labels is the only + # field that can be updated. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of jobs in a project. + # @!attribute [r] jobs + # @return [::Array<::Google::Cloud::Dataproc::V1::Job>] + # Output only. Jobs list. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. This token is included in the response if there are more results + # to fetch. To fetch additional results, provide this value as the + # `page_token` in a subsequent ListJobsRequest. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to cancel a job. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] job_id + # @return [::String] + # Required. The job ID. + class CancelJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a job. + # @!attribute [rw] project_id + # @return [::String] + # Required. The ID of the Google Cloud Platform project that the job + # belongs to. + # @!attribute [rw] region + # @return [::String] + # Required. The Dataproc region in which to handle the request. + # @!attribute [rw] job_id + # @return [::String] + # Required. The job ID. + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb new file mode 100644 index 000000000000..092822819fdb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # A request to create a node group. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this node group will be created. + # Format: `projects/{project}/regions/{region}/clusters/{cluster}` + # @!attribute [rw] node_group + # @return [::Google::Cloud::Dataproc::V1::NodeGroup] + # Required. The node group to create. + # @!attribute [rw] node_group_id + # @return [::String] + # Optional. An optional node group ID. Generated if not specified. + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of from 3 to 33 characters. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class CreateNodeGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to resize a node group. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the node group to resize. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + # @!attribute [rw] size + # @return [::Integer] + # Required. The number of running instances for the node group to maintain. + # The group adds or removes instances to maintain the number of instances + # specified by this parameter. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the server receives + # two + # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + # with the same ID, the second request is ignored and the + # first {::Google::Longrunning::Operation google.longrunning.Operation} created + # and stored in the backend is returned. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The ID must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @!attribute [rw] graceful_decommission_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Timeout for graceful YARN decommissioning. [Graceful + # decommissioning] + # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + # allows the removal of nodes from the Compute Engine node group + # without interrupting jobs in progress. This timeout specifies how long to + # wait for jobs in progress to finish before forcefully removing nodes (and + # potentially interrupting jobs). Default timeout is 0 (for forceful + # decommission), and the maximum allowed timeout is 1 day. (see JSON + # representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # + # Only supported on Dataproc image versions 1.2 and higher. + class ResizeNodeGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get a node group . + # @!attribute [rw] name + # @return [::String] + # Required. The name of the node group to retrieve. + # Format: + # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + class GetNodeGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb new file mode 100644 index 000000000000..6894c7e8cd86 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb @@ -0,0 +1,260 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # Metadata describing the Batch operation. + # @!attribute [rw] batch + # @return [::String] + # Name of the batch for the operation. + # @!attribute [rw] batch_uuid + # @return [::String] + # Batch UUID for the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was created. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + # @!attribute [rw] operation_type + # @return [::Google::Cloud::Dataproc::V1::BatchOperationMetadata::BatchOperationType] + # The operation type. + # @!attribute [rw] description + # @return [::String] + # Short description of the operation. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with the operation. + # @!attribute [rw] warnings + # @return [::Array<::String>] + # Warnings encountered during operation execution. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation type for Batch resources + module BatchOperationType + # Batch operation type is unknown. + BATCH_OPERATION_TYPE_UNSPECIFIED = 0 + + # Batch operation type. + BATCH = 1 + end + end + + # Metadata describing the Session operation. + # @!attribute [rw] session + # @return [::String] + # Name of the session for the operation. + # @!attribute [rw] session_uuid + # @return [::String] + # Session UUID for the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was created. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation was finished. + # @!attribute [rw] operation_type + # @return [::Google::Cloud::Dataproc::V1::SessionOperationMetadata::SessionOperationType] + # The operation type. + # @!attribute [rw] description + # @return [::String] + # Short description of the operation. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with the operation. + # @!attribute [rw] warnings + # @return [::Array<::String>] + # Warnings encountered during operation execution. + class SessionOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation type for Session resources + module SessionOperationType + # Session operation type is unknown. + SESSION_OPERATION_TYPE_UNSPECIFIED = 0 + + # Create Session operation type. + CREATE = 1 + + # Terminate Session operation type. + TERMINATE = 2 + + # Delete Session operation type. + DELETE = 3 + end + end + + # The status of the operation. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus::State] + # Output only. A message containing the operation state. + # @!attribute [r] inner_state + # @return [::String] + # Output only. A message containing the detailed operation state. + # @!attribute [r] details + # @return [::String] + # Output only. A message containing any operation metadata details. + # @!attribute [r] state_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this state was entered. + class ClusterOperationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The operation state. + module State + # Unused. + UNKNOWN = 0 + + # The operation has been created. + PENDING = 1 + + # The operation is running. + RUNNING = 2 + + # The operation is done; either cancelled or completed. + DONE = 3 + end + end + + # Metadata describing the operation. + # @!attribute [r] cluster_name + # @return [::String] + # Output only. Name of the cluster for the operation. + # @!attribute [r] cluster_uuid + # @return [::String] + # Output only. Cluster UUID for the operation. + # @!attribute [r] status + # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus] + # Output only. Current operation status. + # @!attribute [r] status_history + # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterOperationStatus>] + # Output only. The previous operation status. + # @!attribute [r] operation_type + # @return [::String] + # Output only. The operation type. + # @!attribute [r] description + # @return [::String] + # Output only. Short description of operation. + # @!attribute [r] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Labels associated with the operation + # @!attribute [r] warnings + # @return [::Array<::String>] + # Output only. Errors encountered during operation execution. + # @!attribute [r] child_operation_ids + # @return [::Array<::String>] + # Output only. Child operation ids + class ClusterOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Metadata describing the node group operation. + # @!attribute [r] node_group_id + # @return [::String] + # Output only. Node group ID for the operation. + # @!attribute [r] cluster_uuid + # @return [::String] + # Output only. Cluster UUID associated with the node group operation. + # @!attribute [r] status + # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus] + # Output only. Current operation status. + # @!attribute [r] status_history + # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterOperationStatus>] + # Output only. The previous operation status. + # @!attribute [rw] operation_type + # @return [::Google::Cloud::Dataproc::V1::NodeGroupOperationMetadata::NodeGroupOperationType] + # The operation type. + # @!attribute [r] description + # @return [::String] + # Output only. Short description of operation. + # @!attribute [r] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Labels associated with the operation. + # @!attribute [r] warnings + # @return [::Array<::String>] + # Output only. Errors encountered during operation execution. + class NodeGroupOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Operation type for node group resources. + module NodeGroupOperationType + # Node group operation type is unknown. + NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0 + + # Create node group operation type. + CREATE = 1 + + # Update node group operation type. + UPDATE = 2 + + # Delete node group operation type. + DELETE = 3 + + # Resize node group operation type. + RESIZE = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb new file mode 100644 index 000000000000..7b77b0c2310c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # A request to create a session template. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this session template will be created. + # @!attribute [rw] session_template + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # Required. The session template to create. + class CreateSessionTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update a session template. + # @!attribute [rw] session_template + # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] + # Required. The updated session template. + class UpdateSessionTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get the resource representation for a session template. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session template to retrieve. + class GetSessionTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list session templates in a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent that owns this collection of session templates. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter for the session templates to return in the response. + # Filters are case sensitive and have the following syntax: + # + # [field = value] AND [field [= value]] ... + class ListSessionTemplatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of session templates. + # @!attribute [r] session_templates + # @return [::Array<::Google::Cloud::Dataproc::V1::SessionTemplate>] + # Output only. Session template list + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListSessionTemplatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a session template. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session template resource to delete. + class DeleteSessionTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A representation of a session template. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the session template. + # @!attribute [rw] description + # @return [::String] + # Optional. Brief description of the template. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the template was created. + # @!attribute [rw] jupyter_session + # @return [::Google::Cloud::Dataproc::V1::JupyterConfig] + # Optional. Jupyter session config. + # @!attribute [r] creator + # @return [::String] + # Output only. The email address of the user who created the template. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Labels to associate with sessions created using this template. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** can be empty, but, if present, must contain 1 to 63 + # characters and conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with a session. + # @!attribute [rw] runtime_config + # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] + # Optional. Runtime configuration for session execution. + # @!attribute [rw] environment_config + # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] + # Optional. Environment configuration for session execution. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the template was last updated. + # @!attribute [r] uuid + # @return [::String] + # Output only. A session template UUID (Unique Universal Identifier). The + # service generates this value when it creates the session template. + class SessionTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb new file mode 100644 index 000000000000..6c3dcab76966 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb @@ -0,0 +1,295 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # A request to create a session. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this session will be created. + # @!attribute [rw] session + # @return [::Google::Cloud::Dataproc::V1::Session] + # Required. The interactive session to create. + # @!attribute [rw] session_id + # @return [::String] + # Required. The ID to use for the session, which becomes the final component + # of the session's resource name. + # + # This value must be 4-63 characters. Valid characters + # are /[a-z][0-9]-/. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + # with the same ID, the second request is ignored, and the + # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in + # the backend. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class CreateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get the resource representation for a session. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session to retrieve. + class GetSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list sessions in a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of sessions. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of sessions to return in each response. + # The service may return fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token received from a previous `ListSessions` call. + # Provide this token to retrieve the subsequent page. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter for the sessions to return in the response. + # + # A filter is a logical expression constraining the values of various fields + # in each session resource. Filters are case sensitive, and may contain + # multiple clauses combined with logical operators (AND, OR). + # Supported fields are `session_id`, `session_uuid`, `state`, and + # `create_time`. + # + # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + # is a filter for sessions in an ACTIVE state that were created before + # 2023-01-01. + # + # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + # description of the filter syntax and a list of supported comparators. + class ListSessionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of interactive sessions. + # @!attribute [r] sessions + # @return [::Array<::Google::Cloud::Dataproc::V1::Session>] + # Output only. The sessions from the specified collection. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token`, to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListSessionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to terminate an interactive session. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session resource to terminate. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class TerminateSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a session. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session resource to delete. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique ID used to identify the request. If the service + # receives two + # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + # with the same ID, the second request is ignored. + # + # Recommendation: Set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The value must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class DeleteSessionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A representation of a session. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the session. + # @!attribute [r] uuid + # @return [::String] + # Output only. A session UUID (Unique Universal Identifier). The service + # generates this value when it creates the session. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the session was created. + # @!attribute [rw] jupyter_session + # @return [::Google::Cloud::Dataproc::V1::JupyterConfig] + # Optional. Jupyter session config. + # @!attribute [r] runtime_info + # @return [::Google::Cloud::Dataproc::V1::RuntimeInfo] + # Output only. Runtime information about session execution. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::Session::State] + # Output only. A state of the session. + # @!attribute [r] state_message + # @return [::String] + # Output only. Session state details, such as the failure + # description if the state is `FAILED`. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the session entered the current state. + # @!attribute [r] creator + # @return [::String] + # Output only. The email address of the user who created the session. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with the session. + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to [RFC + # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + # associated with a session. + # @!attribute [rw] runtime_config + # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] + # Optional. Runtime configuration for the session execution. + # @!attribute [rw] environment_config + # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] + # Optional. Environment configuration for the session execution. + # @!attribute [rw] user + # @return [::String] + # Optional. The email address of the user who owns the session. + # @!attribute [r] state_history + # @return [::Array<::Google::Cloud::Dataproc::V1::Session::SessionStateHistory>] + # Output only. Historical state information for the session. + # @!attribute [rw] session_template + # @return [::String] + # Optional. The session template used by the session. + # + # Only resource names, including project ID and location, are valid. + # + # Example: + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` + # * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` + # + # The template must be in the same project and Dataproc region as the + # session. + class Session + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Historical state information. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::Session::State] + # Output only. The state of the session at this point in the session + # history. + # @!attribute [r] state_message + # @return [::String] + # Output only. Details about the state at this point in the session + # history. + # @!attribute [r] state_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the session entered the historical state. + class SessionStateHistory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The session state. + module State + # The session state is unknown. + STATE_UNSPECIFIED = 0 + + # The session is created prior to running. + CREATING = 1 + + # The session is running. + ACTIVE = 2 + + # The session is terminating. + TERMINATING = 3 + + # The session is terminated successfully. + TERMINATED = 4 + + # The session is no longer running due to an error. + FAILED = 5 + end + end + + # Jupyter configuration for an interactive session. + # @!attribute [rw] kernel + # @return [::Google::Cloud::Dataproc::V1::JupyterConfig::Kernel] + # Optional. Kernel + # @!attribute [rw] display_name + # @return [::String] + # Optional. Display name, shown in the Jupyter kernelspec card. + class JupyterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Jupyter kernel types. + module Kernel + # The kernel is unknown. + KERNEL_UNSPECIFIED = 0 + + # Python kernel. + PYTHON = 1 + + # Scala kernel. + SCALA = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb new file mode 100644 index 000000000000..e8cb6f9d8267 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb @@ -0,0 +1,627 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # Runtime configuration for a workload. + # @!attribute [rw] version + # @return [::String] + # Optional. Version of the batch runtime. + # @!attribute [rw] container_image + # @return [::String] + # Optional. Optional custom container image for the job runtime environment. + # If not specified, a default container image will be used. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A mapping of property names to values, which are used to + # configure workload execution. + # @!attribute [rw] repository_config + # @return [::Google::Cloud::Dataproc::V1::RepositoryConfig] + # Optional. Dependency repository configuration. + # @!attribute [rw] autotuning_config + # @return [::Google::Cloud::Dataproc::V1::AutotuningConfig] + # Optional. Autotuning configuration of the workload. + # @!attribute [rw] cohort + # @return [::String] + # Optional. Cohort identifier. Identifies families of the workloads having + # the same shape, e.g. daily ETL jobs. + class RuntimeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Environment configuration for a workload. + # @!attribute [rw] execution_config + # @return [::Google::Cloud::Dataproc::V1::ExecutionConfig] + # Optional. Execution configuration for a workload. + # @!attribute [rw] peripherals_config + # @return [::Google::Cloud::Dataproc::V1::PeripheralsConfig] + # Optional. Peripherals configuration that workload has access to. + class EnvironmentConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Execution configuration for a workload. + # @!attribute [rw] service_account + # @return [::String] + # Optional. Service account that used to execute workload. + # @!attribute [rw] network_uri + # @return [::String] + # Optional. Network URI to connect workload to. + # @!attribute [rw] subnetwork_uri + # @return [::String] + # Optional. Subnetwork URI to connect workload to. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # Optional. Tags used for network traffic control. + # @!attribute [rw] kms_key + # @return [::String] + # Optional. The Cloud KMS key to use for encryption. + # @!attribute [rw] idle_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Applies to sessions only. The duration to keep the session alive + # while it's idling. Exceeding this threshold causes the session to + # terminate. This field cannot be set on a batch workload. Minimum value is + # 10 minutes; maximum value is 14 days (see JSON representation of + # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # Defaults to 1 hour if not set. + # If both `ttl` and `idle_ttl` are specified for an interactive session, + # the conditions are treated as `OR` conditions: the workload will be + # terminated when it has been idle for `idle_ttl` or when `ttl` has been + # exceeded, whichever occurs first. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Optional. The duration after which the workload will be terminated, + # specified as the JSON representation for + # [Duration](https://protobuf.dev/programming-guides/proto3/#json). + # When the workload exceeds this duration, it will be unconditionally + # terminated without waiting for ongoing work to finish. If `ttl` is not + # specified for a batch workload, the workload will be allowed to run until + # it exits naturally (or run forever without exiting). If `ttl` is not + # specified for an interactive session, it defaults to 24 hours. If `ttl` is + # not specified for a batch that uses 2.1+ runtime version, it defaults to 4 + # hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl` + # and `idle_ttl` are specified (for an interactive session), the conditions + # are treated as `OR` conditions: the workload will be terminated when it has + # been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs + # first. + # @!attribute [rw] staging_bucket + # @return [::String] + # Optional. A Cloud Storage bucket used to stage workload dependencies, + # config files, and store workload output and other ephemeral data, such as + # Spark history files. If you do not specify a staging bucket, Cloud Dataproc + # will determine a Cloud Storage location according to the region where your + # workload is running, and then create and manage project-level, per-location + # staging and temporary buckets. + # **This field requires a Cloud Storage bucket name, not a `gs://...` URI to + # a Cloud Storage bucket.** + class ExecutionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Spark History Server configuration for the workload. + # @!attribute [rw] dataproc_cluster + # @return [::String] + # Optional. Resource name of an existing Dataproc Cluster to act as a Spark + # History Server for the workload. + # + # Example: + # + # * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + class SparkHistoryServerConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Auxiliary services configuration for a workload. + # @!attribute [rw] metastore_service + # @return [::String] + # Optional. Resource name of an existing Dataproc Metastore service. + # + # Example: + # + # * `projects/[project_id]/locations/[region]/services/[service_id]` + # @!attribute [rw] spark_history_server_config + # @return [::Google::Cloud::Dataproc::V1::SparkHistoryServerConfig] + # Optional. The Spark History Server configuration for the workload. + class PeripheralsConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Runtime information about workload execution. + # @!attribute [r] endpoints + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Map of remote access endpoints (such as web interfaces and + # APIs) to their URIs. + # @!attribute [r] output_uri + # @return [::String] + # Output only. A URI pointing to the location of the stdout and stderr of the + # workload. + # @!attribute [r] diagnostic_output_uri + # @return [::String] + # Output only. A URI pointing to the location of the diagnostics tarball. + # @!attribute [r] approximate_usage + # @return [::Google::Cloud::Dataproc::V1::UsageMetrics] + # Output only. Approximate workload resource usage, calculated when + # the workload completes (see [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # + # **Note:** This metric calculation may change in the future, for + # example, to capture cumulative workload resource + # consumption during workload execution (see the + # [Dataproc Serverless release notes] + # (https://cloud.google.com/dataproc-serverless/docs/release-notes) + # for announcements, changes, fixes + # and other Dataproc developments). + # @!attribute [r] current_usage + # @return [::Google::Cloud::Dataproc::V1::UsageSnapshot] + # Output only. Snapshot of current workload resource usage. + class RuntimeInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EndpointsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Usage metrics represent approximate total resources consumed by a workload. + # @!attribute [rw] milli_dcu_seconds + # @return [::Integer] + # Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`) + # (see [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # @!attribute [rw] shuffle_storage_gb_seconds + # @return [::Integer] + # Optional. Shuffle storage usage in (`GB` x `seconds`) (see + # [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # @!attribute [rw] milli_accelerator_seconds + # @return [::Integer] + # Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see + # [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # @!attribute [rw] accelerator_type + # @return [::String] + # Optional. Accelerator type being used, if any + class UsageMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The usage snapshot represents the resources consumed by a workload at a + # specified time. + # @!attribute [rw] milli_dcu + # @return [::Integer] + # Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see + # [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # @!attribute [rw] shuffle_storage_gb + # @return [::Integer] + # Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless + # pricing] (https://cloud.google.com/dataproc-serverless/pricing)) + # @!attribute [rw] milli_dcu_premium + # @return [::Integer] + # Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at + # premium tier (see [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)). + # @!attribute [rw] shuffle_storage_gb_premium + # @return [::Integer] + # Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see + # [Dataproc Serverless pricing] + # (https://cloud.google.com/dataproc-serverless/pricing)) + # @!attribute [rw] milli_accelerator + # @return [::Integer] + # Optional. Milli (one-thousandth) accelerator. (see [Dataproc + # Serverless pricing] (https://cloud.google.com/dataproc-serverless/pricing)) + # @!attribute [rw] accelerator_type + # @return [::String] + # Optional. Accelerator type being used, if any + # @!attribute [rw] snapshot_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The timestamp of the usage snapshot. + class UsageSnapshot + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The cluster's GKE config. + # @!attribute [rw] gke_cluster_target + # @return [::String] + # Optional. A target GKE cluster to deploy to. It must be in the same project + # and region as the Dataproc cluster (the GKE cluster can be zonal or + # regional). Format: + # 'projects/\\{project}/locations/\\{location}/clusters/\\{cluster_id}' + # @!attribute [rw] node_pool_target + # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolTarget>] + # Optional. GKE node pools where workloads will be scheduled. At least one + # node pool must be assigned the `DEFAULT` + # {::Google::Cloud::Dataproc::V1::GkeNodePoolTarget::Role GkeNodePoolTarget.Role}. + # If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT` + # `GkeNodePoolTarget`. Each role can be given to only one + # `GkeNodePoolTarget`. All node pools must have the same location settings. + class GkeClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for running the Dataproc cluster on Kubernetes. + # @!attribute [rw] kubernetes_namespace + # @return [::String] + # Optional. A namespace within the Kubernetes cluster to deploy into. If this + # namespace does not exist, it is created. If it exists, Dataproc verifies + # that another Dataproc VirtualCluster is not installed into it. If not + # specified, the name of the Dataproc Cluster is used. + # @!attribute [rw] gke_cluster_config + # @return [::Google::Cloud::Dataproc::V1::GkeClusterConfig] + # Required. The configuration for running the Dataproc cluster on GKE. + # @!attribute [rw] kubernetes_software_config + # @return [::Google::Cloud::Dataproc::V1::KubernetesSoftwareConfig] + # Optional. The software configuration for this Dataproc cluster running on + # Kubernetes. + class KubernetesClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The software configuration for this Dataproc cluster running on Kubernetes. + # @!attribute [rw] component_version + # @return [::Google::Protobuf::Map{::String => ::String}] + # The components that should be installed in this Dataproc cluster. The key + # must be a string from the KubernetesComponent enumeration. The value is + # the version of the software to be installed. + # At least one entry must be specified. + # @!attribute [rw] properties + # @return [::Google::Protobuf::Map{::String => ::String}] + # The properties to set on daemon config files. + # + # Property keys are specified in `prefix:property` format, for example + # `spark:spark.kubernetes.container.image`. The following are supported + # prefixes and their mappings: + # + # * spark: `spark-defaults.conf` + # + # For more information, see [Cluster + # properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). + class KubernetesSoftwareConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ComponentVersionEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class PropertiesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # GKE node pools that Dataproc workloads run on. + # @!attribute [rw] node_pool + # @return [::String] + # Required. The target GKE node pool. + # Format: + # 'projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/nodePools/\\{node_pool}' + # @!attribute [rw] roles + # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolTarget::Role>] + # Required. The roles associated with the GKE node pool. + # @!attribute [rw] node_pool_config + # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig] + # Input only. The configuration for the GKE node pool. + # + # If specified, Dataproc attempts to create a node pool with the + # specified shape. If one with the same name already exists, it is + # verified against all specified fields. If a field differs, the + # virtual cluster creation will fail. + # + # If omitted, any node pool with the specified name is used. If a + # node pool with the specified name does not exist, Dataproc create a + # node pool with default values. + # + # This is an input only field. It will not be returned by the API. + class GkeNodePoolTarget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `Role` specifies the tasks that will run on the node pool. Roles can be + # specific to workloads. Exactly one + # {::Google::Cloud::Dataproc::V1::GkeNodePoolTarget GkeNodePoolTarget} within the + # virtual cluster must have the `DEFAULT` role, which is used to run all + # workloads that are not associated with a node pool. + module Role + # Role is unspecified. + ROLE_UNSPECIFIED = 0 + + # At least one node pool must have the `DEFAULT` role. + # Work assigned to a role that is not associated with a node pool + # is assigned to the node pool with the `DEFAULT` role. For example, + # work assigned to the `CONTROLLER` role will be assigned to the node pool + # with the `DEFAULT` role if no node pool has the `CONTROLLER` role. + DEFAULT = 1 + + # Run work associated with the Dataproc control plane (for example, + # controllers and webhooks). Very low resource requirements. + CONTROLLER = 2 + + # Run work associated with a Spark driver of a job. + SPARK_DRIVER = 3 + + # Run work associated with a Spark executor of a job. + SPARK_EXECUTOR = 4 + end + end + + # The configuration of a GKE node pool used by a [Dataproc-on-GKE + # cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). + # @!attribute [rw] config + # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodeConfig] + # Optional. The node pool configuration. + # @!attribute [rw] locations + # @return [::Array<::String>] + # Optional. The list of Compute Engine + # [zones](https://cloud.google.com/compute/docs/zones#available) where + # node pool nodes associated with a Dataproc on GKE virtual cluster + # will be located. + # + # **Note:** All node pools associated with a virtual cluster + # must be located in the same region as the virtual cluster, and they must + # be located in the same zone within that region. + # + # If a location is not specified during node pool creation, Dataproc on GKE + # will choose the zone. + # @!attribute [rw] autoscaling + # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodePoolAutoscalingConfig] + # Optional. The autoscaler configuration for this node pool. The autoscaler + # is enabled only when a valid configuration is present. + class GkeNodePoolConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Parameters that describe cluster nodes. + # @!attribute [rw] machine_type + # @return [::String] + # Optional. The name of a Compute Engine [machine + # type](https://cloud.google.com/compute/docs/machine-types). + # @!attribute [rw] local_ssd_count + # @return [::Integer] + # Optional. The number of local SSD disks to attach to the node, which is + # limited by the maximum number of disks allowable per zone (see [Adding + # Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)). + # @!attribute [rw] preemptible + # @return [::Boolean] + # Optional. Whether the nodes are created as legacy [preemptible VM + # instances] (https://cloud.google.com/compute/docs/instances/preemptible). + # Also see + # {::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodeConfig#spot Spot} + # VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot + # preemptible nodes cannot be used in a node pool with the `CONTROLLER` + # [role] + # (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) + # or in the DEFAULT node pool if the CONTROLLER role is not assigned (the + # DEFAULT node pool will assume the CONTROLLER role). + # @!attribute [rw] accelerators + # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodePoolAcceleratorConfig>] + # Optional. A list of [hardware + # accelerators](https://cloud.google.com/compute/docs/gpus) to attach to + # each node. + # @!attribute [rw] min_cpu_platform + # @return [::String] + # Optional. [Minimum CPU + # platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + # to be used by this instance. The instance may be scheduled on the + # specified or a newer CPU platform. Specify the friendly names of CPU + # platforms, such as "Intel Haswell"` or Intel Sandy Bridge". + # @!attribute [rw] boot_disk_kms_key + # @return [::String] + # Optional. The [Customer Managed Encryption Key (CMEK)] + # (https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek) + # used to encrypt the boot disk attached to each node in the node pool. + # Specify the key using the following format: + # projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME. + # @!attribute [rw] spot + # @return [::Boolean] + # Optional. Whether the nodes are created as [Spot VM instances] + # (https://cloud.google.com/compute/docs/instances/spot). + # Spot VMs are the latest update to legacy + # [preemptible + # VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]. + # Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible + # nodes cannot be used in a node pool with the `CONTROLLER` + # [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) + # or in the DEFAULT node pool if the CONTROLLER role is not assigned (the + # DEFAULT node pool will assume the CONTROLLER role). + class GkeNodeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request + # for a node pool. + # @!attribute [rw] accelerator_count + # @return [::Integer] + # The number of accelerator cards exposed to an instance. + # @!attribute [rw] accelerator_type + # @return [::String] + # The accelerator type resource namename (see GPUs on Compute Engine). + # @!attribute [rw] gpu_partition_size + # @return [::String] + # Size of partitions to create on the GPU. Valid values are described in + # the NVIDIA [mig user + # guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + class GkeNodePoolAcceleratorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GkeNodePoolAutoscaling contains information the cluster autoscaler needs to + # adjust the size of the node pool to the current cluster usage. + # @!attribute [rw] min_node_count + # @return [::Integer] + # The minimum number of nodes in the node pool. Must be >= 0 and <= + # max_node_count. + # @!attribute [rw] max_node_count + # @return [::Integer] + # The maximum number of nodes in the node pool. Must be >= min_node_count, + # and must be > 0. + # **Note:** Quota must be sufficient to scale up the cluster. + class GkeNodePoolAutoscalingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Autotuning configuration of the workload. + # @!attribute [rw] scenarios + # @return [::Array<::Google::Cloud::Dataproc::V1::AutotuningConfig::Scenario>] + # Optional. Scenarios for which tunings are applied. + class AutotuningConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Scenario represents a specific goal that autotuning will attempt to achieve + # by modifying workloads. + module Scenario + # Default value. + SCENARIO_UNSPECIFIED = 0 + + # Scaling recommendations such as initialExecutors. + SCALING = 2 + + # Adding hints for potential relation broadcasts. + BROADCAST_HASH_JOIN = 3 + + # Memory management for workloads. + MEMORY = 4 + end + end + + # Configuration for dependency repositories + # @!attribute [rw] pypi_repository_config + # @return [::Google::Cloud::Dataproc::V1::PyPiRepositoryConfig] + # Optional. Configuration for PyPi repository. + class RepositoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for PyPi repository + # @!attribute [rw] pypi_repository + # @return [::String] + # Optional. PyPi repository address + class PyPiRepositoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cluster components that can be activated. + module Component + # Unspecified component. Specifying this will cause Cluster creation to fail. + COMPONENT_UNSPECIFIED = 0 + + # The Anaconda python distribution. The Anaconda component is not supported + # in the Dataproc [2.0 image] + # (/https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-release-2.0). + # The 2.0 image is pre-installed with Miniconda. + ANACONDA = 5 + + # Docker + DOCKER = 13 + + # The Druid query engine. (alpha) + DRUID = 9 + + # Flink + FLINK = 14 + + # HBase. (beta) + HBASE = 11 + + # The Hive Web HCatalog (the REST service for accessing HCatalog). + HIVE_WEBHCAT = 3 + + # Hudi. + HUDI = 18 + + # The Jupyter Notebook. + JUPYTER = 1 + + # The Presto query engine. + PRESTO = 6 + + # The Trino query engine. + TRINO = 17 + + # The Ranger service. + RANGER = 12 + + # The Solr service. + SOLR = 10 + + # The Zeppelin notebook. + ZEPPELIN = 4 + + # The Zookeeper service. + ZOOKEEPER = 8 + end + + # Actions in response to failure of a resource associated with a cluster. + module FailureAction + # When FailureAction is unspecified, failure action defaults to NO_ACTION. + FAILURE_ACTION_UNSPECIFIED = 0 + + # Take no action on failure to create a cluster resource. NO_ACTION is the + # default. + NO_ACTION = 1 + + # Delete the failed cluster resource. + DELETE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb new file mode 100644 index 000000000000..ad588c68d801 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb @@ -0,0 +1,726 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataproc + module V1 + # A Dataproc workflow template resource. + # @!attribute [rw] id + # @return [::String] + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates`, the resource name of the + # template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates`, the resource name of the + # template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @!attribute [rw] version + # @return [::Integer] + # Optional. Used to perform a consistent read-modify-write. + # + # This field should be left blank for a `CreateWorkflowTemplate` request. It + # is required for an `UpdateWorkflowTemplate` request, and must match the + # current server version. A typical update template flow would fetch the + # current template with a `GetWorkflowTemplate` request, which will return + # the current template with the `version` field filled in with the + # current server version. The user updates other fields in the template, + # then returns it as part of the `UpdateWorkflowTemplate` request. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time template was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time template was last updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this template. These labels + # will be propagated to all jobs and clusters created by the workflow + # instance. + # + # Label **keys** must contain 1 to 63 characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # + # Label **values** may be empty, but, if present, must contain 1 to 63 + # characters, and must conform to + # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + # + # No more than 32 labels can be associated with a template. + # @!attribute [rw] placement + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplatePlacement] + # Required. WorkflowTemplate scheduling information. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Dataproc::V1::OrderedJob>] + # Required. The Directed Acyclic Graph of Jobs to submit. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::Dataproc::V1::TemplateParameter>] + # Optional. Template parameters whose values are substituted into the + # template. Values for parameters must be provided when the template is + # instantiated. + # @!attribute [rw] dag_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Timeout duration for the DAG of jobs, expressed in seconds (see + # [JSON representation of + # duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # The timeout duration must be from 10 minutes ("600s") to 24 hours + # ("86400s"). The timer begins when the first job is submitted. If the + # workflow is running at the end of the timeout period, any remaining jobs + # are cancelled, the workflow is ended, and if the workflow was running on a + # [managed + # cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), + # the cluster is deleted. + class WorkflowTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Specifies workflow execution target. + # + # Either `managed_cluster` or `cluster_selector` is required. + # @!attribute [rw] managed_cluster + # @return [::Google::Cloud::Dataproc::V1::ManagedCluster] + # A cluster that is managed by the workflow. + # @!attribute [rw] cluster_selector + # @return [::Google::Cloud::Dataproc::V1::ClusterSelector] + # Optional. A selector that chooses target cluster for jobs based + # on metadata. + # + # The selector is evaluated at the time each job is submitted. + class WorkflowTemplatePlacement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cluster that is managed by the workflow. + # @!attribute [rw] cluster_name + # @return [::String] + # Required. The cluster name prefix. A unique cluster name will be formed by + # appending a random suffix. + # + # The name must contain only lower-case letters (a-z), numbers (0-9), + # and hyphens (-). Must begin with a letter. Cannot begin or end with + # hyphen. Must consist of between 2 and 35 characters. + # @!attribute [rw] config + # @return [::Google::Cloud::Dataproc::V1::ClusterConfig] + # Required. The cluster configuration. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this cluster. + # + # Label keys must be between 1 and 63 characters long, and must conform to + # the following PCRE regular expression: + # [\p\\{Ll}\p\\{Lo}][\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,62} + # + # Label values must be between 1 and 63 characters long, and must conform to + # the following PCRE regular expression: [\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,63} + # + # No more than 32 labels can be associated with a given cluster. + class ManagedCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A selector that chooses target cluster for jobs based on metadata. + # @!attribute [rw] zone + # @return [::String] + # Optional. The zone where workflow process executes. This parameter does not + # affect the selection of the cluster. + # + # If unspecified, the zone of the first cluster matching the selector + # is used. + # @!attribute [rw] cluster_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Required. The cluster labels. Cluster must have all labels + # to match. + class ClusterSelector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ClusterLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A job executed by the workflow. + # @!attribute [rw] step_id + # @return [::String] + # Required. The step id. The id must be unique among all jobs + # within the template. + # + # The step id is used as prefix for job id, as job + # `goog-dataproc-workflow-step-id` label, and in + # {::Google::Cloud::Dataproc::V1::OrderedJob#prerequisite_step_ids prerequisiteStepIds} + # field from other steps. + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). Cannot begin or end with underscore + # or hyphen. Must consist of between 3 and 50 characters. + # @!attribute [rw] hadoop_job + # @return [::Google::Cloud::Dataproc::V1::HadoopJob] + # Optional. Job is a Hadoop job. + # @!attribute [rw] spark_job + # @return [::Google::Cloud::Dataproc::V1::SparkJob] + # Optional. Job is a Spark job. + # @!attribute [rw] pyspark_job + # @return [::Google::Cloud::Dataproc::V1::PySparkJob] + # Optional. Job is a PySpark job. + # @!attribute [rw] hive_job + # @return [::Google::Cloud::Dataproc::V1::HiveJob] + # Optional. Job is a Hive job. + # @!attribute [rw] pig_job + # @return [::Google::Cloud::Dataproc::V1::PigJob] + # Optional. Job is a Pig job. + # @!attribute [rw] spark_r_job + # @return [::Google::Cloud::Dataproc::V1::SparkRJob] + # Optional. Job is a SparkR job. + # @!attribute [rw] spark_sql_job + # @return [::Google::Cloud::Dataproc::V1::SparkSqlJob] + # Optional. Job is a SparkSql job. + # @!attribute [rw] presto_job + # @return [::Google::Cloud::Dataproc::V1::PrestoJob] + # Optional. Job is a Presto job. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to associate with this job. + # + # Label keys must be between 1 and 63 characters long, and must conform to + # the following regular expression: + # [\p\\{Ll}\p\\{Lo}][\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,62} + # + # Label values must be between 1 and 63 characters long, and must conform to + # the following regular expression: [\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,63} + # + # No more than 32 labels can be associated with a given job. + # @!attribute [rw] scheduling + # @return [::Google::Cloud::Dataproc::V1::JobScheduling] + # Optional. Job scheduling configuration. + # @!attribute [rw] prerequisite_step_ids + # @return [::Array<::String>] + # Optional. The optional list of prerequisite job step_ids. + # If not specified, the job will start at the beginning of workflow. + class OrderedJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A configurable parameter that replaces one or more fields in the template. + # Parameterizable fields: + # - Labels + # - File uris + # - Job properties + # - Job arguments + # - Script variables + # - Main class (in HadoopJob and SparkJob) + # - Zone (in ClusterSelector) + # @!attribute [rw] name + # @return [::String] + # Required. Parameter name. + # The parameter name is used as the key, and paired with the + # parameter value, which are passed to the template when the template + # is instantiated. + # The name must contain only capital letters (A-Z), numbers (0-9), and + # underscores (_), and must not start with a number. The maximum length is + # 40 characters. + # @!attribute [rw] fields + # @return [::Array<::String>] + # Required. Paths to all fields that the parameter replaces. + # A field is allowed to appear in at most one parameter's list of field + # paths. + # + # A field path is similar in syntax to a + # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. For example, a + # field path that references the zone field of a workflow template's cluster + # selector would be specified as `placement.clusterSelector.zone`. + # + # Also, field paths can reference fields using the following syntax: + # + # * Values in maps can be referenced by key: + # * labels['key'] + # * placement.clusterSelector.clusterLabels['key'] + # * placement.managedCluster.labels['key'] + # * placement.clusterSelector.clusterLabels['key'] + # * jobs['step-id'].labels['key'] + # + # * Jobs in the jobs list can be referenced by step-id: + # * jobs['step-id'].hadoopJob.mainJarFileUri + # * jobs['step-id'].hiveJob.queryFileUri + # * jobs['step-id'].pySparkJob.mainPythonFileUri + # * jobs['step-id'].hadoopJob.jarFileUris[0] + # * jobs['step-id'].hadoopJob.archiveUris[0] + # * jobs['step-id'].hadoopJob.fileUris[0] + # * jobs['step-id'].pySparkJob.pythonFileUris[0] + # + # * Items in repeated fields can be referenced by a zero-based index: + # * jobs['step-id'].sparkJob.args[0] + # + # * Other examples: + # * jobs['step-id'].hadoopJob.properties['key'] + # * jobs['step-id'].hadoopJob.args[0] + # * jobs['step-id'].hiveJob.scriptVariables['key'] + # * jobs['step-id'].hadoopJob.mainJarFileUri + # * placement.clusterSelector.zone + # + # It may not be possible to parameterize maps and repeated fields in their + # entirety since only individual map values and individual items in repeated + # fields can be referenced. For example, the following field paths are + # invalid: + # + # - placement.clusterSelector.clusterLabels + # - jobs['step-id'].sparkJob.args + # @!attribute [rw] description + # @return [::String] + # Optional. Brief description of the parameter. + # Must not exceed 1024 characters. + # @!attribute [rw] validation + # @return [::Google::Cloud::Dataproc::V1::ParameterValidation] + # Optional. Validation rules to be applied to this parameter's value. + class TemplateParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for parameter validation. + # @!attribute [rw] regex + # @return [::Google::Cloud::Dataproc::V1::RegexValidation] + # Validation based on regular expressions. + # @!attribute [rw] values + # @return [::Google::Cloud::Dataproc::V1::ValueValidation] + # Validation based on a list of allowed values. + class ParameterValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Validation based on regular expressions. + # @!attribute [rw] regexes + # @return [::Array<::String>] + # Required. RE2 regular expressions used to validate the parameter's value. + # The value must match the regex in its entirety (substring + # matches are not sufficient). + class RegexValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Validation based on a list of allowed values. + # @!attribute [rw] values + # @return [::Array<::String>] + # Required. List of allowed values for the parameter. + class ValueValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Dataproc workflow template resource. + # @!attribute [r] template + # @return [::String] + # Output only. The resource name of the workflow template as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates`, the resource name of the + # template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates`, the resource name of the + # template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @!attribute [r] version + # @return [::Integer] + # Output only. The version of template at the time of + # workflow instantiation. + # @!attribute [r] create_cluster + # @return [::Google::Cloud::Dataproc::V1::ClusterOperation] + # Output only. The create cluster operation metadata. + # @!attribute [r] graph + # @return [::Google::Cloud::Dataproc::V1::WorkflowGraph] + # Output only. The workflow graph. + # @!attribute [r] delete_cluster + # @return [::Google::Cloud::Dataproc::V1::ClusterOperation] + # Output only. The delete cluster operation metadata. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::WorkflowMetadata::State] + # Output only. The workflow state. + # @!attribute [r] cluster_name + # @return [::String] + # Output only. The name of the target cluster. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from parameter names to values that were used for those parameters. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Workflow start time. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Workflow end time. + # @!attribute [r] cluster_uuid + # @return [::String] + # Output only. The UUID of target cluster. + # @!attribute [r] dag_timeout + # @return [::Google::Protobuf::Duration] + # Output only. The timeout duration for the DAG of jobs, expressed in seconds + # (see [JSON representation of + # duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + # @!attribute [r] dag_start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. DAG start time, only set for workflows with + # {::Google::Cloud::Dataproc::V1::WorkflowMetadata#dag_timeout dag_timeout} when + # DAG begins. + # @!attribute [r] dag_end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. DAG end time, only set for workflows with + # {::Google::Cloud::Dataproc::V1::WorkflowMetadata#dag_timeout dag_timeout} when + # DAG ends. + class WorkflowMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The operation state. + module State + # Unused. + UNKNOWN = 0 + + # The operation has been created. + PENDING = 1 + + # The operation is running. + RUNNING = 2 + + # The operation is done; either cancelled or completed. + DONE = 3 + end + end + + # The cluster operation triggered by a workflow. + # @!attribute [r] operation_id + # @return [::String] + # Output only. The id of the cluster operation. + # @!attribute [r] error + # @return [::String] + # Output only. Error, if operation failed. + # @!attribute [r] done + # @return [::Boolean] + # Output only. Indicates the operation is done. + class ClusterOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The workflow graph. + # @!attribute [r] nodes + # @return [::Array<::Google::Cloud::Dataproc::V1::WorkflowNode>] + # Output only. The workflow nodes. + class WorkflowGraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The workflow node. + # @!attribute [r] step_id + # @return [::String] + # Output only. The name of the node. + # @!attribute [r] prerequisite_step_ids + # @return [::Array<::String>] + # Output only. Node's prerequisite nodes. + # @!attribute [r] job_id + # @return [::String] + # Output only. The job id; populated after the node enters RUNNING state. + # @!attribute [r] state + # @return [::Google::Cloud::Dataproc::V1::WorkflowNode::NodeState] + # Output only. The node state. + # @!attribute [r] error + # @return [::String] + # Output only. The error detail. + class WorkflowNode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The workflow node state. + module NodeState + # State is unspecified. + NODE_STATE_UNSPECIFIED = 0 + + # The node is awaiting prerequisite node to finish. + BLOCKED = 1 + + # The node is runnable but not running. + RUNNABLE = 2 + + # The node is running. + RUNNING = 3 + + # The node completed successfully. + COMPLETED = 4 + + # The node failed. A node can be marked FAILED because + # its ancestor or peer failed. + FAILED = 5 + end + end + + # A request to create a workflow template. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.create`, the resource name of the + # region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.create`, the resource name of + # the location has the following format: + # `projects/{project_id}/locations/{location}` + # @!attribute [rw] template + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # Required. The Dataproc workflow template to create. + class CreateWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to fetch a workflow template. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.get`, the resource name of the + # template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @!attribute [rw] version + # @return [::Integer] + # Optional. The version of workflow template to retrieve. Only previously + # instantiated versions can be retrieved. + # + # If unspecified, retrieves the current version. + class GetWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to instantiate a workflow template. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @!attribute [rw] version + # @return [::Integer] + # Optional. The version of workflow template to instantiate. If specified, + # the workflow will be instantiated only if the current version of + # the workflow template has the supplied version. + # + # This option cannot be used to instantiate a previous version of + # workflow template. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Map from parameter names to values that should be used for those + # parameters. Values may not exceed 1000 characters. + class InstantiateWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ParametersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A request to instantiate an inline workflow template. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,instantiateinline`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.instantiateinline`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @!attribute [rw] template + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # Required. The workflow template to instantiate. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A tag that prevents multiple concurrent workflow + # instances with the same tag from running. This mitigates risk of + # concurrent instances started due to retries. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The tag must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. + class InstantiateInlineWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update a workflow template. + # @!attribute [rw] template + # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] + # Required. The updated workflow template. + # + # The `template.version` field must match the current version. + class UpdateWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list workflow templates in a project. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the region or location, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates,list`, the resource + # name of the region has the following format: + # `projects/{project_id}/regions/{region}` + # + # * For `projects.locations.workflowTemplates.list`, the + # resource name of the location has the following format: + # `projects/{project_id}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to return in each response. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The page token, returned by a previous call, to request the + # next page of results. + class ListWorkflowTemplatesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response to a request to list workflow templates in a project. + # @!attribute [r] templates + # @return [::Array<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] + # Output only. WorkflowTemplates list. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. This token is included in the response if there are more + # results to fetch. To fetch additional results, provide this value as the + # page_token in a subsequent ListWorkflowTemplatesRequest. + class ListWorkflowTemplatesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to delete a workflow template. + # + # Currently started workflows will remain running. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the workflow template, as described + # in https://cloud.google.com/apis/design/resource_names. + # + # * For `projects.regions.workflowTemplates.delete`, the resource name + # of the template has the following format: + # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + # + # * For `projects.locations.workflowTemplates.instantiate`, the resource name + # of the template has the following format: + # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + # @!attribute [rw] version + # @return [::Integer] + # Optional. The version of workflow template to delete. If specified, + # will only delete the template if the current server version matches + # specified version. + class DeleteWorkflowTemplateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..fb4d6862eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..5160138862c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..09acc69b6125 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..41c8c3a565cc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb new file mode 100644 index 000000000000..ba88575c495d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a time interval, encoded as a Timestamp start (inclusive) and a + # Timestamp end (exclusive). + # + # The start must be less than or equal to the end. + # When the start equals the end, the interval is empty (matches no time). + # When both start and end are unspecified, the interval matches any time. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Inclusive start of the interval. + # + # If specified, a Timestamp matching this interval will have to be the same + # or after the start. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Exclusive end of the interval. + # + # If specified, a Timestamp matching this interval will have to be before the + # end. + class Interval + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile new file mode 100644 index 000000000000..399b57da62ae --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-dataproc-v1", path: "../" +else + gem "google-cloud-dataproc-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb new file mode 100644 index 000000000000..1013c3635891 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_autoscaling_policy call in the AutoscalingPolicyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy. +# +def create_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new + + # Call the create_autoscaling_policy method. + result = client.create_autoscaling_policy request + + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end +# [END dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb new file mode 100644 index 000000000000..614430cd10ca --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_autoscaling_policy call in the AutoscalingPolicyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy. +# +def delete_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new + + # Call the delete_autoscaling_policy method. + result = client.delete_autoscaling_policy request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb new file mode 100644 index 000000000000..b4878b69f69d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_autoscaling_policy call in the AutoscalingPolicyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy. +# +def get_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new + + # Call the get_autoscaling_policy method. + result = client.get_autoscaling_policy request + + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end +# [END dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb new file mode 100644 index 000000000000..dbeca302abb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_autoscaling_policies call in the AutoscalingPolicyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies. +# +def list_autoscaling_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new + + # Call the list_autoscaling_policies method. + result = client.list_autoscaling_policies request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p item + end +end +# [END dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb new file mode 100644 index 000000000000..f2b7fea4f4d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the update_autoscaling_policy call in the AutoscalingPolicyService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy. +# +def update_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new + + # Call the update_autoscaling_policy method. + result = client.update_autoscaling_policy request + + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end +# [END dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb new file mode 100644 index 000000000000..22943f710c46 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_BatchController_CreateBatch_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_batch call in the BatchController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#create_batch. +# +def create_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new + + # Call the create_batch method. + result = client.create_batch request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_BatchController_CreateBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb new file mode 100644 index 000000000000..2e0543267f4d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_BatchController_DeleteBatch_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_batch call in the BatchController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch. +# +def delete_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new + + # Call the delete_batch method. + result = client.delete_batch request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dataproc_v1_generated_BatchController_DeleteBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb new file mode 100644 index 000000000000..81cf2824caf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_BatchController_GetBatch_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_batch call in the BatchController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#get_batch. +# +def get_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetBatchRequest.new + + # Call the get_batch method. + result = client.get_batch request + + # The returned object is of type Google::Cloud::Dataproc::V1::Batch. + p result +end +# [END dataproc_v1_generated_BatchController_GetBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb new file mode 100644 index 000000000000..8632f4e50266 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_BatchController_ListBatches_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_batches call in the BatchController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#list_batches. +# +def list_batches + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new + + # Call the list_batches method. + result = client.list_batches request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. + p item + end +end +# [END dataproc_v1_generated_BatchController_ListBatches_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb new file mode 100644 index 000000000000..31b268bc5b81 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_CreateCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb new file mode 100644 index 000000000000..8bab1695944d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_DeleteCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb new file mode 100644 index 000000000000..4d80905b018d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the diagnose_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster. +# +def diagnose_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new + + # Call the diagnose_cluster method. + result = client.diagnose_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb new file mode 100644 index 000000000000..6c7eb2b60430 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_GetCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. + p result +end +# [END dataproc_v1_generated_ClusterController_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb new file mode 100644 index 000000000000..1e8e38dc0d76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_ListClusters_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_clusters call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. + p item + end +end +# [END dataproc_v1_generated_ClusterController_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb new file mode 100644 index 000000000000..c4af0a5092cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_StartCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the start_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster. +# +def start_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::StartClusterRequest.new + + # Call the start_cluster method. + result = client.start_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_StartCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb new file mode 100644 index 000000000000..5e3b6ed71412 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_StopCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the stop_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster. +# +def stop_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::StopClusterRequest.new + + # Call the stop_cluster method. + result = client.stop_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_StopCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb new file mode 100644 index 000000000000..448a674c6830 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_ClusterController_UpdateCluster_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the update_cluster call in the ClusterController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_ClusterController_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb new file mode 100644 index 000000000000..9460258efc9e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_CancelJob_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the cancel_job call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#cancel_job. +# +def cancel_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + + # Call the cancel_job method. + result = client.cancel_job request + + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end +# [END dataproc_v1_generated_JobController_CancelJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb new file mode 100644 index 000000000000..9e698c5a7191 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_DeleteJob_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_job call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dataproc_v1_generated_JobController_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb new file mode 100644 index 000000000000..2c32c1b86c10 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_GetJob_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_job call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end +# [END dataproc_v1_generated_JobController_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb new file mode 100644 index 000000000000..3eeffe70a163 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_ListJobs_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_jobs call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + p item + end +end +# [END dataproc_v1_generated_JobController_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb new file mode 100644 index 000000000000..067e8dca0d58 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_SubmitJob_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the submit_job call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#submit_job. +# +def submit_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + + # Call the submit_job method. + result = client.submit_job request + + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end +# [END dataproc_v1_generated_JobController_SubmitJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb new file mode 100644 index 000000000000..f56e8e674c2d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the submit_job_as_operation call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation. +# +def submit_job_as_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + + # Call the submit_job_as_operation method. + result = client.submit_job_as_operation request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb new file mode 100644 index 000000000000..e28bdccc6927 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_JobController_UpdateJob_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the update_job call in the JobController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#update_job. +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end +# [END dataproc_v1_generated_JobController_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb new file mode 100644 index 000000000000..31a35dfd5520 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_node_group call in the NodeGroupController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group. +# +def create_node_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new + + # Call the create_node_group method. + result = client.create_node_group request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb new file mode 100644 index 000000000000..348430f95647 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_node_group call in the NodeGroupController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group. +# +def get_node_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new + + # Call the get_node_group method. + result = client.get_node_group request + + # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. + p result +end +# [END dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb new file mode 100644 index 000000000000..77651983eecf --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the resize_node_group call in the NodeGroupController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group. +# +def resize_node_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new + + # Call the resize_node_group method. + result = client.resize_node_group request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb new file mode 100644 index 000000000000..22145c40ff6f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionController_CreateSession_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_session call in the SessionController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionController::Client#create_session. +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new + + # Call the create_session method. + result = client.create_session request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_SessionController_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb new file mode 100644 index 000000000000..cb5fedba7be8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionController_DeleteSession_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_session call in the SessionController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionController::Client#delete_session. +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new + + # Call the delete_session method. + result = client.delete_session request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_SessionController_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb new file mode 100644 index 000000000000..7bc88ca7afc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionController_GetSession_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_session call in the SessionController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionController::Client#get_session. +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetSessionRequest.new + + # Call the get_session method. + result = client.get_session request + + # The returned object is of type Google::Cloud::Dataproc::V1::Session. + p result +end +# [END dataproc_v1_generated_SessionController_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb new file mode 100644 index 000000000000..7d1cf3e41e45 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionController_ListSessions_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_sessions call in the SessionController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions. +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new + + # Call the list_sessions method. + result = client.list_sessions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::Session. + p item + end +end +# [END dataproc_v1_generated_SessionController_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb new file mode 100644 index 000000000000..752d432d5d4c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionController_TerminateSession_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the terminate_session call in the SessionController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session. +# +def terminate_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new + + # Call the terminate_session method. + result = client.terminate_session request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_SessionController_TerminateSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb new file mode 100644 index 000000000000..60e89a646609 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_session_template call in the SessionTemplateController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template. +# +def create_session_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new + + # Call the create_session_template method. + result = client.create_session_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + p result +end +# [END dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb new file mode 100644 index 000000000000..549873d4a4da --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_session_template call in the SessionTemplateController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template. +# +def delete_session_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new + + # Call the delete_session_template method. + result = client.delete_session_template request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb new file mode 100644 index 000000000000..02731253f9dc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_session_template call in the SessionTemplateController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template. +# +def get_session_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new + + # Call the get_session_template method. + result = client.get_session_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + p result +end +# [END dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb new file mode 100644 index 000000000000..9347e8965aa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_session_templates call in the SessionTemplateController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates. +# +def list_session_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new + + # Call the list_session_templates method. + result = client.list_session_templates request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. + p item + end +end +# [END dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb new file mode 100644 index 000000000000..c7fb2ad26da6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the update_session_template call in the SessionTemplateController service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template. +# +def update_session_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new + + # Call the update_session_template method. + result = client.update_session_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. + p result +end +# [END dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json b/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json new file mode 100644 index 000000000000..4913822f1f17 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json @@ -0,0 +1,1775 @@ +{ + "client_library": { + "name": "google-cloud-dataproc-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.dataproc.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync", + "title": "Snippet for the create_autoscaling_policy call in the AutoscalingPolicyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy.", + "file": "autoscaling_policy_service/create_autoscaling_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_autoscaling_policy", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", + "client": { + "short_name": "AutoscalingPolicyService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" + }, + "method": { + "short_name": "CreateAutoscalingPolicy", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", + "service": { + "short_name": "AutoscalingPolicyService", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync", + "title": "Snippet for the update_autoscaling_policy call in the AutoscalingPolicyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy.", + "file": "autoscaling_policy_service/update_autoscaling_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_autoscaling_policy", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", + "client": { + "short_name": "AutoscalingPolicyService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" + }, + "method": { + "short_name": "UpdateAutoscalingPolicy", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", + "service": { + "short_name": "AutoscalingPolicyService", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync", + "title": "Snippet for the get_autoscaling_policy call in the AutoscalingPolicyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy.", + "file": "autoscaling_policy_service/get_autoscaling_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_autoscaling_policy", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", + "client": { + "short_name": "AutoscalingPolicyService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" + }, + "method": { + "short_name": "GetAutoscalingPolicy", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", + "service": { + "short_name": "AutoscalingPolicyService", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync", + "title": "Snippet for the list_autoscaling_policies call in the AutoscalingPolicyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies.", + "file": "autoscaling_policy_service/list_autoscaling_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_autoscaling_policies", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse", + "client": { + "short_name": "AutoscalingPolicyService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" + }, + "method": { + "short_name": "ListAutoscalingPolicies", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", + "service": { + "short_name": "AutoscalingPolicyService", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync", + "title": "Snippet for the delete_autoscaling_policy call in the AutoscalingPolicyService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy.", + "file": "autoscaling_policy_service/delete_autoscaling_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_autoscaling_policy", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "AutoscalingPolicyService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" + }, + "method": { + "short_name": "DeleteAutoscalingPolicy", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", + "service": { + "short_name": "AutoscalingPolicyService", + "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_BatchController_CreateBatch_sync", + "title": "Snippet for the create_batch call in the BatchController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#create_batch.", + "file": "batch_controller/create_batch.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_batch", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#create_batch", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateBatchRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BatchController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" + }, + "method": { + "short_name": "CreateBatch", + "full_name": "google.cloud.dataproc.v1.BatchController.CreateBatch", + "service": { + "short_name": "BatchController", + "full_name": "google.cloud.dataproc.v1.BatchController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_BatchController_GetBatch_sync", + "title": "Snippet for the get_batch call in the BatchController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#get_batch.", + "file": "batch_controller/get_batch.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_batch", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#get_batch", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetBatchRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Batch", + "client": { + "short_name": "BatchController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" + }, + "method": { + "short_name": "GetBatch", + "full_name": "google.cloud.dataproc.v1.BatchController.GetBatch", + "service": { + "short_name": "BatchController", + "full_name": "google.cloud.dataproc.v1.BatchController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_BatchController_ListBatches_sync", + "title": "Snippet for the list_batches call in the BatchController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#list_batches.", + "file": "batch_controller/list_batches.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_batches", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#list_batches", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListBatchesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListBatchesResponse", + "client": { + "short_name": "BatchController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" + }, + "method": { + "short_name": "ListBatches", + "full_name": "google.cloud.dataproc.v1.BatchController.ListBatches", + "service": { + "short_name": "BatchController", + "full_name": "google.cloud.dataproc.v1.BatchController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_BatchController_DeleteBatch_sync", + "title": "Snippet for the delete_batch call in the BatchController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch.", + "file": "batch_controller/delete_batch.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_batch", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteBatchRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "BatchController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" + }, + "method": { + "short_name": "DeleteBatch", + "full_name": "google.cloud.dataproc.v1.BatchController.DeleteBatch", + "service": { + "short_name": "BatchController", + "full_name": "google.cloud.dataproc.v1.BatchController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster.", + "file": "cluster_controller/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.CreateCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster.", + "file": "cluster_controller/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_StopCluster_sync", + "title": "Snippet for the stop_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster.", + "file": "cluster_controller/stop_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::StopClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "StopCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.StopCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_StartCluster_sync", + "title": "Snippet for the start_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster.", + "file": "cluster_controller/start_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::StartClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "StartCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.StartCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster.", + "file": "cluster_controller/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_GetCluster_sync", + "title": "Snippet for the get_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster.", + "file": "cluster_controller/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Cluster", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.GetCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_ListClusters_sync", + "title": "Snippet for the list_clusters call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters.", + "file": "cluster_controller/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListClustersResponse", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.dataproc.v1.ClusterController.ListClusters", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_ClusterController_DiagnoseCluster_sync", + "title": "Snippet for the diagnose_cluster call in the ClusterController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster.", + "file": "cluster_controller/diagnose_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "diagnose_cluster", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ClusterController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" + }, + "method": { + "short_name": "DiagnoseCluster", + "full_name": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", + "service": { + "short_name": "ClusterController", + "full_name": "google.cloud.dataproc.v1.ClusterController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_SubmitJob_sync", + "title": "Snippet for the submit_job call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#submit_job.", + "file": "job_controller/submit_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "submit_job", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#submit_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::SubmitJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Job", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "SubmitJob", + "full_name": "google.cloud.dataproc.v1.JobController.SubmitJob", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_SubmitJobAsOperation_sync", + "title": "Snippet for the submit_job_as_operation call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation.", + "file": "job_controller/submit_job_as_operation.rb", + "language": "RUBY", + "client_method": { + "short_name": "submit_job_as_operation", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::SubmitJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "SubmitJobAsOperation", + "full_name": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_GetJob_sync", + "title": "Snippet for the get_job call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#get_job.", + "file": "job_controller/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Job", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.dataproc.v1.JobController.GetJob", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_ListJobs_sync", + "title": "Snippet for the list_jobs call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#list_jobs.", + "file": "job_controller/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListJobsResponse", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.dataproc.v1.JobController.ListJobs", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_UpdateJob_sync", + "title": "Snippet for the update_job call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#update_job.", + "file": "job_controller/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Job", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.dataproc.v1.JobController.UpdateJob", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_CancelJob_sync", + "title": "Snippet for the cancel_job call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#cancel_job.", + "file": "job_controller/cancel_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_job", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#cancel_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CancelJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Job", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "CancelJob", + "full_name": "google.cloud.dataproc.v1.JobController.CancelJob", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_JobController_DeleteJob_sync", + "title": "Snippet for the delete_job call in the JobController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#delete_job.", + "file": "job_controller/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "JobController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.dataproc.v1.JobController.DeleteJob", + "service": { + "short_name": "JobController", + "full_name": "google.cloud.dataproc.v1.JobController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync", + "title": "Snippet for the create_node_group call in the NodeGroupController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group.", + "file": "node_group_controller/create_node_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_node_group", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "NodeGroupController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" + }, + "method": { + "short_name": "CreateNodeGroup", + "full_name": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", + "service": { + "short_name": "NodeGroupController", + "full_name": "google.cloud.dataproc.v1.NodeGroupController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync", + "title": "Snippet for the resize_node_group call in the NodeGroupController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group.", + "file": "node_group_controller/resize_node_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "resize_node_group", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "NodeGroupController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" + }, + "method": { + "short_name": "ResizeNodeGroup", + "full_name": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", + "service": { + "short_name": "NodeGroupController", + "full_name": "google.cloud.dataproc.v1.NodeGroupController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync", + "title": "Snippet for the get_node_group call in the NodeGroupController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group.", + "file": "node_group_controller/get_node_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_node_group", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetNodeGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::NodeGroup", + "client": { + "short_name": "NodeGroupController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" + }, + "method": { + "short_name": "GetNodeGroup", + "full_name": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", + "service": { + "short_name": "NodeGroupController", + "full_name": "google.cloud.dataproc.v1.NodeGroupController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionController_CreateSession_sync", + "title": "Snippet for the create_session call in the SessionController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#create_session.", + "file": "session_controller/create_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#create_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SessionController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" + }, + "method": { + "short_name": "CreateSession", + "full_name": "google.cloud.dataproc.v1.SessionController.CreateSession", + "service": { + "short_name": "SessionController", + "full_name": "google.cloud.dataproc.v1.SessionController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionController_GetSession_sync", + "title": "Snippet for the get_session call in the SessionController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#get_session.", + "file": "session_controller/get_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#get_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::Session", + "client": { + "short_name": "SessionController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" + }, + "method": { + "short_name": "GetSession", + "full_name": "google.cloud.dataproc.v1.SessionController.GetSession", + "service": { + "short_name": "SessionController", + "full_name": "google.cloud.dataproc.v1.SessionController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionController_ListSessions_sync", + "title": "Snippet for the list_sessions call in the SessionController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions.", + "file": "session_controller/list_sessions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sessions", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListSessionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListSessionsResponse", + "client": { + "short_name": "SessionController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" + }, + "method": { + "short_name": "ListSessions", + "full_name": "google.cloud.dataproc.v1.SessionController.ListSessions", + "service": { + "short_name": "SessionController", + "full_name": "google.cloud.dataproc.v1.SessionController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionController_TerminateSession_sync", + "title": "Snippet for the terminate_session call in the SessionController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session.", + "file": "session_controller/terminate_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "terminate_session", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::TerminateSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SessionController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" + }, + "method": { + "short_name": "TerminateSession", + "full_name": "google.cloud.dataproc.v1.SessionController.TerminateSession", + "service": { + "short_name": "SessionController", + "full_name": "google.cloud.dataproc.v1.SessionController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionController_DeleteSession_sync", + "title": "Snippet for the delete_session call in the SessionController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#delete_session.", + "file": "session_controller/delete_session.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#delete_session", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteSessionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "SessionController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" + }, + "method": { + "short_name": "DeleteSession", + "full_name": "google.cloud.dataproc.v1.SessionController.DeleteSession", + "service": { + "short_name": "SessionController", + "full_name": "google.cloud.dataproc.v1.SessionController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync", + "title": "Snippet for the create_session_template call in the SessionTemplateController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template.", + "file": "session_template_controller/create_session_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session_template", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", + "client": { + "short_name": "SessionTemplateController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" + }, + "method": { + "short_name": "CreateSessionTemplate", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", + "service": { + "short_name": "SessionTemplateController", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync", + "title": "Snippet for the update_session_template call in the SessionTemplateController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template.", + "file": "session_template_controller/update_session_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_session_template", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", + "client": { + "short_name": "SessionTemplateController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" + }, + "method": { + "short_name": "UpdateSessionTemplate", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", + "service": { + "short_name": "SessionTemplateController", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync", + "title": "Snippet for the get_session_template call in the SessionTemplateController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template.", + "file": "session_template_controller/get_session_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session_template", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", + "client": { + "short_name": "SessionTemplateController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" + }, + "method": { + "short_name": "GetSessionTemplate", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", + "service": { + "short_name": "SessionTemplateController", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync", + "title": "Snippet for the list_session_templates call in the SessionTemplateController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates.", + "file": "session_template_controller/list_session_templates.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_session_templates", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse", + "client": { + "short_name": "SessionTemplateController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" + }, + "method": { + "short_name": "ListSessionTemplates", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", + "service": { + "short_name": "SessionTemplateController", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync", + "title": "Snippet for the delete_session_template call in the SessionTemplateController service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template.", + "file": "session_template_controller/delete_session_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session_template", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SessionTemplateController::Client", + "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" + }, + "method": { + "short_name": "DeleteSessionTemplate", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", + "service": { + "short_name": "SessionTemplateController", + "full_name": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync", + "title": "Snippet for the create_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template.", + "file": "workflow_template_service/create_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "CreateWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync", + "title": "Snippet for the get_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template.", + "file": "workflow_template_service/get_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "GetWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync", + "title": "Snippet for the instantiate_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template.", + "file": "workflow_template_service/instantiate_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "instantiate_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "InstantiateWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync", + "title": "Snippet for the instantiate_inline_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template.", + "file": "workflow_template_service/instantiate_inline_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "instantiate_inline_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "InstantiateInlineWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync", + "title": "Snippet for the update_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template.", + "file": "workflow_template_service/update_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "UpdateWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync", + "title": "Snippet for the list_workflow_templates call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates.", + "file": "workflow_template_service/list_workflow_templates.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workflow_templates", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "ListWorkflowTemplates", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync", + "title": "Snippet for the delete_workflow_template call in the WorkflowTemplateService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template.", + "file": "workflow_template_service/delete_workflow_template.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workflow_template", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "WorkflowTemplateService::Client", + "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" + }, + "method": { + "short_name": "DeleteWorkflowTemplate", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", + "service": { + "short_name": "WorkflowTemplateService", + "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb new file mode 100644 index 000000000000..110943c02c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the create_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template. +# +def create_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new + + # Call the create_workflow_template method. + result = client.create_workflow_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end +# [END dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb new file mode 100644 index 000000000000..ed94503ab560 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the delete_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template. +# +def delete_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new + + # Call the delete_workflow_template method. + result = client.delete_workflow_template request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb new file mode 100644 index 000000000000..cb74684314dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the get_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template. +# +def get_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new + + # Call the get_workflow_template method. + result = client.get_workflow_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end +# [END dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb new file mode 100644 index 000000000000..40356b98ecef --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the instantiate_inline_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template. +# +def instantiate_inline_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new + + # Call the instantiate_inline_workflow_template method. + result = client.instantiate_inline_workflow_template request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb new file mode 100644 index 000000000000..eda2221a3097 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the instantiate_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template. +# +def instantiate_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new + + # Call the instantiate_workflow_template method. + result = client.instantiate_workflow_template request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb new file mode 100644 index 000000000000..9962ac035bae --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the list_workflow_templates call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates. +# +def list_workflow_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new + + # Call the list_workflow_templates method. + result = client.list_workflow_templates request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. + p item + end +end +# [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb new file mode 100644 index 000000000000..ab55ae13bc03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] +require "google/cloud/dataproc/v1" + +## +# Snippet for the update_workflow_template call in the WorkflowTemplateService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template. +# +def update_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new + + # Call the update_workflow_template method. + result = client.update_workflow_template request + + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end +# [END dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb new file mode 100644 index 000000000000..9b7db69c4e43 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/autoscaling_policy_service" + +class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_autoscaling_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.autoscaling_policy_path project: "value0", location: "value1", autoscaling_policy: "value2" + assert_equal "projects/value0/locations/value1/autoscalingPolicies/value2", path + + path = client.autoscaling_policy_path project: "value0", region: "value1", autoscaling_policy: "value2" + assert_equal "projects/value0/regions/value1/autoscalingPolicies/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_region_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.region_path project: "value0", region: "value1" + assert_equal "projects/value0/regions/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb new file mode 100644 index 000000000000..24f5221a0c00 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb @@ -0,0 +1,364 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/autoscaling_policies_pb" +require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" + + +class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_autoscaling_policy + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy = {} + + create_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_create_autoscaling_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_autoscaling_policy({ parent: parent, policy: policy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_autoscaling_policy parent: parent, policy: policy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_autoscaling_policy ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_autoscaling_policy({ parent: parent, policy: policy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_autoscaling_policy(::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_autoscaling_policy_client_stub.call_count + end + end + end + + def test_update_autoscaling_policy + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + policy = {} + + update_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_update_autoscaling_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_autoscaling_policy({ policy: policy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_autoscaling_policy policy: policy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_autoscaling_policy ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_autoscaling_policy({ policy: policy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_autoscaling_policy(::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_autoscaling_policy_client_stub.call_count + end + end + end + + def test_get_autoscaling_policy + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_get_autoscaling_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_autoscaling_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_autoscaling_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_autoscaling_policy ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_autoscaling_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_autoscaling_policy(::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_autoscaling_policy_client_stub.call_count + end + end + end + + def test_list_autoscaling_policies + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_autoscaling_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_list_autoscaling_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_autoscaling_policies_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_autoscaling_policies parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_autoscaling_policies ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_autoscaling_policies(::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_autoscaling_policies_client_stub.call_count + end + end + end + + def test_delete_autoscaling_policy + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_delete_autoscaling_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_autoscaling_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_autoscaling_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_autoscaling_policy ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_autoscaling_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_autoscaling_policy(::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_autoscaling_policy_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb new file mode 100644 index 000000000000..5c583048bd04 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb @@ -0,0 +1,377 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/autoscaling_policies_pb" +require "google/cloud/dataproc/v1/autoscaling_policies_services_pb" +require "google/cloud/dataproc/v1/autoscaling_policy_service" + +class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_autoscaling_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy = {} + + create_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_autoscaling_policy, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::AutoscalingPolicy), request["policy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_autoscaling_policy({ parent: parent, policy: policy }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_autoscaling_policy parent: parent, policy: policy do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_autoscaling_policy ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_autoscaling_policy({ parent: parent, policy: policy }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_autoscaling_policy(::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_autoscaling_policy_client_stub.call_rpc_count + end + end + + def test_update_autoscaling_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + policy = {} + + update_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_autoscaling_policy, name + assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::AutoscalingPolicy), request["policy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_autoscaling_policy({ policy: policy }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_autoscaling_policy policy: policy do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_autoscaling_policy ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_autoscaling_policy({ policy: policy }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_autoscaling_policy(::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_autoscaling_policy_client_stub.call_rpc_count + end + end + + def test_get_autoscaling_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_autoscaling_policy, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_autoscaling_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_autoscaling_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_autoscaling_policy ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_autoscaling_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_autoscaling_policy(::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_autoscaling_policy_client_stub.call_rpc_count + end + end + + def test_list_autoscaling_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_autoscaling_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_autoscaling_policies, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_autoscaling_policies_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_autoscaling_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_autoscaling_policies ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_autoscaling_policies(::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_autoscaling_policies_client_stub.call_rpc_count + end + end + + def test_delete_autoscaling_policy + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_autoscaling_policy, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_autoscaling_policy_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_autoscaling_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_autoscaling_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_autoscaling_policy ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_autoscaling_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_autoscaling_policy(::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_autoscaling_policy_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb new file mode 100644 index 000000000000..08b61efbdfa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/batches_pb" +require "google/cloud/dataproc/v1/batches_services_pb" +require "google/cloud/dataproc/v1/batch_controller" + +class ::Google::Cloud::Dataproc::V1::BatchController::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb new file mode 100644 index 000000000000..a69c9847e4c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/batch_controller" + +class ::Google::Cloud::Dataproc::V1::BatchController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_batch_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.batch_path project: "value0", location: "value1", batch: "value2" + assert_equal "projects/value0/locations/value1/batches/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/services/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb new file mode 100644 index 000000000000..4eb34166d9d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb @@ -0,0 +1,314 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/batches_pb" +require "google/cloud/dataproc/v1/batch_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::BatchController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_batch + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + batch = {} + batch_id = "hello world" + request_id = "hello world" + + create_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_create_batch_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_batch parent: parent, batch: batch, batch_id: batch_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_batch ::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_batch(::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_batch_client_stub.call_count + end + end + end + + def test_get_batch + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Batch.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_get_batch_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_batch({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_batch name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_batch ::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_batch({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_batch(::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_batch_client_stub.call_count + end + end + end + + def test_list_batches + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_batches_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_list_batches_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_batches_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_batches parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_batches ::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_batches(::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_batches_client_stub.call_count + end + end + end + + def test_delete_batch + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_delete_batch_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_batch({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_batch name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_batch ::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_batch({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_batch(::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_batch_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb new file mode 100644 index 000000000000..cb853560fe82 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb @@ -0,0 +1,346 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/batches_pb" +require "google/cloud/dataproc/v1/batches_services_pb" +require "google/cloud/dataproc/v1/batch_controller" + +class ::Google::Cloud::Dataproc::V1::BatchController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_batch + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + batch = {} + batch_id = "hello world" + request_id = "hello world" + + create_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_batch, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateBatchRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Batch), request["batch"] + assert_equal "hello world", request["batch_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_batch parent: parent, batch: batch, batch_id: batch_id, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_batch ::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_batch(::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_batch_client_stub.call_rpc_count + end + end + + def test_get_batch + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Batch.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_batch, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetBatchRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_batch({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_batch name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_batch ::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_batch({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_batch(::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_batch_client_stub.call_rpc_count + end + end + + def test_list_batches + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_batches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_batches, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListBatchesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_batches_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_batches parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_batches ::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_batches(::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_batches_client_stub.call_rpc_count + end + end + + def test_delete_batch + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_batch, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteBatchRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_batch_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_batch({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_batch name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_batch ::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_batch({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_batch(::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_batch_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb new file mode 100644 index 000000000000..d940559f0061 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/clusters_pb" +require "google/cloud/dataproc/v1/clusters_services_pb" +require "google/cloud/dataproc/v1/cluster_controller" + +class ::Google::Cloud::Dataproc::V1::ClusterController::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb new file mode 100644 index 000000000000..8018d298871e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/cluster_controller" + +class ::Google::Cloud::Dataproc::V1::ClusterController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_node_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" + assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/services/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb new file mode 100644 index 000000000000..19860ea432ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb @@ -0,0 +1,558 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/clusters_pb" +require "google/cloud/dataproc/v1/cluster_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster = {} + request_id = "hello world" + action_on_failed_primary_workers = :FAILURE_ACTION_UNSPECIFIED + + create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster = {} + graceful_decommission_timeout = {} + update_mask = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_stop_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + stop_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_stop_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_cluster ::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_cluster(::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_cluster_client_stub.call_count + end + end + end + + def test_start_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + start_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_start_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_cluster ::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_cluster(::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + + get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster project_id: project_id, region: region, cluster_name: cluster_name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListClustersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_clusters project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_count + end + end + end + + def test_diagnose_cluster + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + tarball_gcs_dir = "hello world" + tarball_access = :TARBALL_ACCESS_UNSPECIFIED + diagnosis_interval = {} + jobs = ["hello world"] + yarn_application_ids = ["hello world"] + + diagnose_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_diagnose_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, diagnose_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, diagnose_cluster_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb new file mode 100644 index 000000000000..a703e8bd2001 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb @@ -0,0 +1,659 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/clusters_pb" +require "google/cloud/dataproc/v1/clusters_services_pb" +require "google/cloud/dataproc/v1/cluster_controller" + +class ::Google::Cloud::Dataproc::V1::ClusterController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster = {} + request_id = "hello world" + action_on_failed_primary_workers = :FAILURE_ACTION_UNSPECIFIED + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal :FAILURE_ACTION_UNSPECIFIED, request["action_on_failed_primary_workers"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_cluster project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster = {} + graceful_decommission_timeout = {} + update_mask = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Cluster), request["cluster"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["graceful_decommission_timeout"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_rpc_count + end + end + + def test_stop_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + stop_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::StopClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + assert_equal "hello world", request["cluster_uuid"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stop_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stop_cluster ::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stop_cluster(::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, stop_cluster_client_stub.call_rpc_count + end + end + + def test_start_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + start_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::StartClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + assert_equal "hello world", request["cluster_uuid"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.start_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.start_cluster ::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.start_cluster(::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, start_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + cluster_uuid = "hello world" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + assert_equal "hello world", request["cluster_uuid"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Cluster.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + + get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster project_id: project_id, region: region, cluster_name: cluster_name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_rpc_count + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListClustersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListClustersRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_clusters project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_clusters ::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_clusters(::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_clusters_client_stub.call_rpc_count + end + end + + def test_diagnose_cluster + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + cluster_name = "hello world" + tarball_gcs_dir = "hello world" + tarball_access = :TARBALL_ACCESS_UNSPECIFIED + diagnosis_interval = {} + jobs = ["hello world"] + yarn_application_ids = ["hello world"] + + diagnose_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :diagnose_cluster, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["cluster_name"] + assert_equal "hello world", request["tarball_gcs_dir"] + assert_equal :TARBALL_ACCESS_UNSPECIFIED, request["tarball_access"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Type::Interval), request["diagnosis_interval"] + assert_equal ["hello world"], request["jobs"] + assert_equal ["hello world"], request["yarn_application_ids"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, diagnose_cluster_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, diagnose_cluster_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb new file mode 100644 index 000000000000..e0b5bc59a56f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/jobs_pb" +require "google/cloud/dataproc/v1/jobs_services_pb" +require "google/cloud/dataproc/v1/job_controller" + +class ::Google::Cloud::Dataproc::V1::JobController::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb new file mode 100644 index 000000000000..c7181d685f92 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb @@ -0,0 +1,491 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/jobs_pb" +require "google/cloud/dataproc/v1/job_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::JobController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_submit_job + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job = {} + request_id = "hello world" + + submit_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_submit_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, submit_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.submit_job project_id: project_id, region: region, job: job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.submit_job ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.submit_job(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, submit_job_client_stub.call_count + end + end + end + + def test_submit_job_as_operation + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job = {} + request_id = "hello world" + + submit_job_as_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_submit_job_as_operation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, submit_job_as_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.submit_job_as_operation project_id: project_id, region: region, job: job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.submit_job_as_operation ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.submit_job_as_operation(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, submit_job_as_operation_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job project_id: project_id, region: region, job_id: job_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + page_size = 42 + page_token = "hello world" + cluster_name = "hello world" + job_state_matcher = :ALL + filter = "hello world" + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_update_job + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_job project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_job ::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_count + end + end + end + + def test_cancel_job + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + cancel_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_cancel_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_job project_id: project_id, region: region, job_id: job_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_job ::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_job(::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job project_id: project_id, region: region, job_id: job_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb new file mode 100644 index 000000000000..a9665112c72f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb @@ -0,0 +1,550 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/jobs_pb" +require "google/cloud/dataproc/v1/jobs_services_pb" +require "google/cloud/dataproc/v1/job_controller" + +class ::Google::Cloud::Dataproc::V1::JobController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_submit_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job = {} + request_id = "hello world" + + submit_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :submit_job, name + assert_kind_of ::Google::Cloud::Dataproc::V1::SubmitJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, submit_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.submit_job project_id: project_id, region: region, job: job, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.submit_job ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.submit_job(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, submit_job_client_stub.call_rpc_count + end + end + + def test_submit_job_as_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job = {} + request_id = "hello world" + + submit_job_as_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :submit_job_as_operation, name + assert_kind_of ::Google::Cloud::Dataproc::V1::SubmitJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, submit_job_as_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.submit_job_as_operation project_id: project_id, region: region, job: job, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.submit_job_as_operation ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.submit_job_as_operation(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, submit_job_as_operation_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["job_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job project_id: project_id, region: region, job_id: job_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + page_size = 42 + page_token = "hello world" + cluster_name = "hello world" + job_state_matcher = :ALL + filter = "hello world" + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListJobsRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["cluster_name"] + assert_equal :ALL, request["job_state_matcher"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + job = {} + update_mask = {} + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_cancel_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + cancel_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_job, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CancelJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["job_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_job project_id: project_id, region: region, job_id: job_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_job ::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_job(::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + project_id = "hello world" + region = "hello world" + job_id = "hello world" + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteJobRequest, request + assert_equal "hello world", request["project_id"] + assert_equal "hello world", request["region"] + assert_equal "hello world", request["job_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job project_id: project_id, region: region, job_id: job_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb new file mode 100644 index 000000000000..fefa806d74c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/node_groups_pb" +require "google/cloud/dataproc/v1/node_groups_services_pb" +require "google/cloud/dataproc/v1/node_group_controller" + +class ::Google::Cloud::Dataproc::V1::NodeGroupController::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb new file mode 100644 index 000000000000..5cec88637d85 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/node_group_controller" + +class ::Google::Cloud::Dataproc::V1::NodeGroupController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_cluster_region_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_region_path project: "value0", region: "value1", cluster: "value2" + assert_equal "projects/value0/regions/value1/clusters/value2", path + end + end + + def test_node_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" + assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb new file mode 100644 index 000000000000..0f7702673030 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/node_groups_pb" +require "google/cloud/dataproc/v1/node_group_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_node_group + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + node_group = {} + node_group_id = "hello world" + request_id = "hello world" + + create_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_create_node_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_node_group parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_node_group ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_node_group(::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_node_group_client_stub.call_count + end + end + end + + def test_resize_node_group + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + size = 42 + request_id = "hello world" + graceful_decommission_timeout = {} + + resize_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_resize_node_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resize_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resize_node_group name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resize_node_group ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resize_node_group(::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resize_node_group_client_stub.call_count + end + end + end + + def test_get_node_group + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::NodeGroup.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_get_node_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_node_group({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_node_group name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_node_group ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_node_group({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_node_group(::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_node_group_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb new file mode 100644 index 000000000000..07edbcfffde5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/node_groups_pb" +require "google/cloud/dataproc/v1/node_groups_services_pb" +require "google/cloud/dataproc/v1/node_group_controller" + +class ::Google::Cloud::Dataproc::V1::NodeGroupController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_node_group + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + node_group = {} + node_group_id = "hello world" + request_id = "hello world" + + create_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_node_group, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::NodeGroup), request["node_group"] + assert_equal "hello world", request["node_group_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_node_group parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_node_group ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_node_group(::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_node_group_client_stub.call_rpc_count + end + end + + def test_resize_node_group + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + size = 42 + request_id = "hello world" + graceful_decommission_timeout = {} + + resize_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resize_node_group, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["size"] + assert_equal "hello world", request["request_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["graceful_decommission_timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resize_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resize_node_group name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resize_node_group ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resize_node_group(::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resize_node_group_client_stub.call_rpc_count + end + end + + def test_get_node_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::NodeGroup.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_node_group, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_node_group_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_node_group({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_node_group name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_node_group ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_node_group({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_node_group(::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_node_group_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb new file mode 100644 index 000000000000..cbac7503a6d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/sessions_pb" +require "google/cloud/dataproc/v1/sessions_services_pb" +require "google/cloud/dataproc/v1/session_controller" + +class ::Google::Cloud::Dataproc::V1::SessionController::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb new file mode 100644 index 000000000000..17cc5f86e43f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/session_controller" + +class ::Google::Cloud::Dataproc::V1::SessionController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/services/value2", path + end + end + + def test_session_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", location: "value1", session: "value2" + assert_equal "projects/value0/locations/value1/sessions/value2", path + end + end + + def test_session_template_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_template_path project: "value0", location: "value1", template: "value2" + assert_equal "projects/value0/locations/value1/sessionTemplates/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb new file mode 100644 index 000000000000..c8949ee6b987 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb @@ -0,0 +1,369 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/sessions_pb" +require "google/cloud/dataproc/v1/session_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::SessionController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_session + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + session_id = "hello world" + request_id = "hello world" + + create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_session parent: parent, session: session, session_id: session_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_session ::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_count + end + end + end + + def test_get_session + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::Session.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session ::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_count + end + end + end + + def test_list_sessions + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_count + end + end + end + + def test_terminate_session + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + terminate_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_terminate_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, terminate_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.terminate_session({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.terminate_session name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.terminate_session ::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.terminate_session({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.terminate_session(::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, terminate_session_client_stub.call_count + end + end + end + + def test_delete_session + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session ::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb new file mode 100644 index 000000000000..52580344c7eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb @@ -0,0 +1,416 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/sessions_pb" +require "google/cloud/dataproc/v1/sessions_services_pb" +require "google/cloud/dataproc/v1/session_controller" + +class ::Google::Cloud::Dataproc::V1::SessionController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_session + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session = {} + session_id = "hello world" + request_id = "hello world" + + create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateSessionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Session), request["session"] + assert_equal "hello world", request["session_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session parent: parent, session: session, session_id: session_id, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session ::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session(::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_client_stub.call_rpc_count + end + end + + def test_get_session + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::Session.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetSessionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session ::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session(::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_client_stub.call_rpc_count + end + end + + def test_list_sessions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sessions, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListSessionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sessions_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_sessions ::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_sessions(::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_sessions_client_stub.call_rpc_count + end + end + + def test_terminate_session + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + terminate_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :terminate_session, name + assert_kind_of ::Google::Cloud::Dataproc::V1::TerminateSessionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, terminate_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.terminate_session({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.terminate_session name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.terminate_session ::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.terminate_session({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.terminate_session(::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, terminate_session_client_stub.call_rpc_count + end + end + + def test_delete_session + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteSessionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session ::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_session(::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_session_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb new file mode 100644 index 000000000000..0c4fc328676c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/session_template_controller" + +class ::Google::Cloud::Dataproc::V1::SessionTemplateController::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/services/value2", path + end + end + + def test_session_template_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_template_path project: "value0", location: "value1", template: "value2" + assert_equal "projects/value0/locations/value1/sessionTemplates/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb new file mode 100644 index 000000000000..1e392c9d3d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb @@ -0,0 +1,365 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/session_templates_pb" +require "google/cloud/dataproc/v1/session_template_controller/rest" + + +class ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_session_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session_template = {} + + create_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_create_session_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_session_template({ parent: parent, session_template: session_template }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_session_template parent: parent, session_template: session_template do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_session_template ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_session_template({ parent: parent, session_template: session_template }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_session_template(::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_template_client_stub.call_count + end + end + end + + def test_update_session_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session_template = {} + + update_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_update_session_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_session_template({ session_template: session_template }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_session_template session_template: session_template do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_session_template ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_session_template({ session_template: session_template }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_session_template(::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_session_template_client_stub.call_count + end + end + end + + def test_get_session_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_get_session_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_session_template({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_session_template name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_session_template ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_session_template({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_session_template(::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_template_client_stub.call_count + end + end + end + + def test_list_session_templates + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_session_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_list_session_templates_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_session_templates_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_session_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_session_templates ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_session_templates(::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_session_templates_client_stub.call_count + end + end + end + + def test_delete_session_template + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_delete_session_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_session_template({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_session_template name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_session_template ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_session_template({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_session_template(::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_template_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb new file mode 100644 index 000000000000..ca4068b9c38d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb @@ -0,0 +1,379 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/session_templates_pb" +require "google/cloud/dataproc/v1/session_templates_services_pb" +require "google/cloud/dataproc/v1/session_template_controller" + +class ::Google::Cloud::Dataproc::V1::SessionTemplateController::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_session_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session_template = {} + + create_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::SessionTemplate), request["session_template"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_session_template({ parent: parent, session_template: session_template }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_session_template parent: parent, session_template: session_template do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_session_template ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_session_template({ parent: parent, session_template: session_template }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_session_template(::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_template_client_stub.call_rpc_count + end + end + + def test_update_session_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + session_template = {} + + update_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_session_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::SessionTemplate), request["session_template"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_session_template({ session_template: session_template }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_session_template session_template: session_template do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_session_template ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_session_template({ session_template: session_template }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_session_template(::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_session_template_client_stub.call_rpc_count + end + end + + def test_get_session_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_session_template({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_session_template name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_session_template ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_session_template({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_session_template(::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_session_template_client_stub.call_rpc_count + end + end + + def test_list_session_templates + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_session_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_session_templates, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_session_templates_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_session_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_session_templates ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_session_templates(::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_session_templates_client_stub.call_rpc_count + end + end + + def test_delete_session_template + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_session_template({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_session_template name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_session_template ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_session_template({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_session_template(::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_session_template_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb new file mode 100644 index 000000000000..b32bcd2dad33 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/workflow_templates_pb" +require "google/cloud/dataproc/v1/workflow_templates_services_pb" +require "google/cloud/dataproc/v1/workflow_template_service" + +class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb new file mode 100644 index 000000000000..33c8421bd454 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/workflow_template_service" + +class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_node_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" + assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path + end + end + + def test_region_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.region_path project: "value0", region: "value1" + assert_equal "projects/value0/regions/value1", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", service: "value2" + assert_equal "projects/value0/locations/value1/services/value2", path + end + end + + def test_workflow_template_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_template_path project: "value0", region: "value1", workflow_template: "value2" + assert_equal "projects/value0/regions/value1/workflowTemplates/value2", path + + path = client.workflow_template_path project: "value0", location: "value1", workflow_template: "value2" + assert_equal "projects/value0/locations/value1/workflowTemplates/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb new file mode 100644 index 000000000000..bf37fd83489d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb @@ -0,0 +1,479 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/dataproc/v1/workflow_templates_pb" +require "google/cloud/dataproc/v1/workflow_template_service/rest" + + +class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_workflow_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + template = {} + + create_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_create_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workflow_template({ parent: parent, template: template }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workflow_template parent: parent, template: template do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workflow_template ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workflow_template({ parent: parent, template: template }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workflow_template(::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workflow_template_client_stub.call_count + end + end + end + + def test_get_workflow_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + + get_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_get_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workflow_template({ name: name, version: version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workflow_template name: name, version: version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workflow_template ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workflow_template({ name: name, version: version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workflow_template(::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workflow_template_client_stub.call_count + end + end + end + + def test_instantiate_workflow_template + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + request_id = "hello world" + parameters = {} + + instantiate_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_instantiate_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, instantiate_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.instantiate_workflow_template name: name, version: version, request_id: request_id, parameters: parameters do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.instantiate_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.instantiate_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, instantiate_workflow_template_client_stub.call_count + end + end + end + + def test_instantiate_inline_workflow_template + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + template = {} + request_id = "hello world" + + instantiate_inline_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_instantiate_inline_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, instantiate_inline_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.instantiate_inline_workflow_template parent: parent, template: template, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.instantiate_inline_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.instantiate_inline_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, instantiate_inline_workflow_template_client_stub.call_count + end + end + end + + def test_update_workflow_template + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + template = {} + + update_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_update_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workflow_template({ template: template }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workflow_template template: template do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workflow_template ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workflow_template({ template: template }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workflow_template(::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workflow_template_client_stub.call_count + end + end + end + + def test_list_workflow_templates + # Create test objects. + client_result = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_workflow_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_list_workflow_templates_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workflow_templates_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_workflow_templates parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_workflow_templates ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_workflow_templates(::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_workflow_templates_client_stub.call_count + end + end + end + + def test_delete_workflow_template + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + + delete_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_delete_workflow_template_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workflow_template({ name: name, version: version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workflow_template name: name, version: version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workflow_template ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workflow_template({ name: name, version: version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workflow_template(::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workflow_template_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb new file mode 100644 index 000000000000..f7d1d07e0585 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb @@ -0,0 +1,531 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dataproc/v1/workflow_templates_pb" +require "google/cloud/dataproc/v1/workflow_templates_services_pb" +require "google/cloud/dataproc/v1/workflow_template_service" + +class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + template = {} + + create_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workflow_template({ parent: parent, template: template }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_workflow_template parent: parent, template: template do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_workflow_template ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_workflow_template({ parent: parent, template: template }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_workflow_template(::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_workflow_template_client_stub.call_rpc_count + end + end + + def test_get_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + + get_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workflow_template({ name: name, version: version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workflow_template name: name, version: version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workflow_template ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workflow_template({ name: name, version: version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_workflow_template(::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_workflow_template_client_stub.call_rpc_count + end + end + + def test_instantiate_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + request_id = "hello world" + parameters = {} + + instantiate_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :instantiate_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["version"] + assert_equal "hello world", request["request_id"] + assert_equal({}, request["parameters"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, instantiate_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.instantiate_workflow_template name: name, version: version, request_id: request_id, parameters: parameters do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.instantiate_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.instantiate_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, instantiate_workflow_template_client_stub.call_rpc_count + end + end + + def test_instantiate_inline_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + template = {} + request_id = "hello world" + + instantiate_inline_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :instantiate_inline_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, instantiate_inline_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.instantiate_inline_workflow_template parent: parent, template: template, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.instantiate_inline_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.instantiate_inline_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, instantiate_inline_workflow_template_client_stub.call_rpc_count + end + end + + def test_update_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + template = {} + + update_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workflow_template({ template: template }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_workflow_template template: template do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_workflow_template ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_workflow_template({ template: template }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_workflow_template(::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_workflow_template_client_stub.call_rpc_count + end + end + + def test_list_workflow_templates + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_workflow_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workflow_templates, name + assert_kind_of ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_workflow_templates_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_workflow_templates parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_workflow_templates ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_workflow_templates(::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_workflow_templates_client_stub.call_rpc_count + end + end + + def test_delete_workflow_template + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + version = 42 + + delete_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workflow_template, name + assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workflow_template_client_stub do + # Create client + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workflow_template({ name: name, version: version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_workflow_template name: name, version: version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_workflow_template ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_workflow_template({ name: name, version: version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_workflow_template(::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_workflow_template_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From ce18bf7f1758b05e709ce0b68325f9a841126841 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 31 Aug 2024 00:06:50 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../dataproc/v1/cluster_controller/client.rb | 5 +- .../v1/cluster_controller/rest/client.rb | 5 +- .../google/cloud/dataproc/v1/clusters_pb.rb | 3 +- .../google/cloud/dataproc/v1/clusters.rb | 18 + .../v1/cluster_controller_rest_test.rb | 11 +- .../dataproc/v1/cluster_controller_test.rb | 12 +- .../google-cloud-dataproc-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-dataproc-v1/.rubocop.yml | 33 - .../google-cloud-dataproc-v1/.toys.rb | 28 - .../google-cloud-dataproc-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 -- .../google-cloud-dataproc-v1/CHANGELOG.md | 2 - .../google-cloud-dataproc-v1/Gemfile | 11 - .../google-cloud-dataproc-v1/LICENSE.md | 201 -- .../google-cloud-dataproc-v1/README.md | 143 -- .../google-cloud-dataproc-v1/Rakefile | 169 -- .../gapic_metadata.json | 301 --- .../google-cloud-dataproc-v1.gemspec | 29 - .../lib/google-cloud-dataproc-v1.rb | 21 - .../lib/google/cloud/dataproc/v1.rb | 52 - .../dataproc/v1/autoscaling_policies_pb.rb | 59 - .../v1/autoscaling_policies_services_pb.rb | 58 - .../dataproc/v1/autoscaling_policy_service.rb | 56 - .../v1/autoscaling_policy_service/client.rb | 885 -------- .../autoscaling_policy_service/credentials.rb | 51 - .../v1/autoscaling_policy_service/paths.rb | 110 - .../v1/autoscaling_policy_service/rest.rb | 54 - .../autoscaling_policy_service/rest/client.rb | 832 -------- .../rest/service_stub.rb | 403 ---- .../cloud/dataproc/v1/batch_controller.rb | 56 - .../dataproc/v1/batch_controller/client.rb | 798 -------- .../v1/batch_controller/credentials.rb | 51 - .../v1/batch_controller/operations.rb | 809 -------- .../dataproc/v1/batch_controller/paths.rb | 88 - .../dataproc/v1/batch_controller/rest.rb | 54 - .../v1/batch_controller/rest/client.rb | 752 ------- .../v1/batch_controller/rest/operations.rb | 929 --------- .../v1/batch_controller/rest/service_stub.rb | 306 --- .../google/cloud/dataproc/v1/batches_pb.rb | 64 - .../cloud/dataproc/v1/batches_services_pb.rb | 52 - .../cloud/dataproc/v1/bindings_override.rb | 257 --- .../cloud/dataproc/v1/cluster_controller.rb | 57 - .../dataproc/v1/cluster_controller/client.rb | 1464 -------------- .../v1/cluster_controller/credentials.rb | 51 - .../v1/cluster_controller/operations.rb | 809 -------- .../dataproc/v1/cluster_controller/paths.rb | 92 - .../dataproc/v1/cluster_controller/rest.rb | 55 - .../v1/cluster_controller/rest/client.rb | 1348 ------------- .../v1/cluster_controller/rest/operations.rb | 929 --------- .../cluster_controller/rest/service_stub.rb | 560 ------ .../google/cloud/dataproc/v1/clusters_pb.rb | 112 -- .../cloud/dataproc/v1/clusters_services_pb.rb | 75 - .../cloud/dataproc/v1/job_controller.rb | 55 - .../dataproc/v1/job_controller/client.rb | 1192 ----------- .../dataproc/v1/job_controller/credentials.rb | 51 - .../dataproc/v1/job_controller/operations.rb | 809 -------- .../cloud/dataproc/v1/job_controller/rest.rb | 53 - .../dataproc/v1/job_controller/rest/client.rb | 1092 ---------- .../v1/job_controller/rest/operations.rb | 929 --------- .../v1/job_controller/rest/service_stub.rb | 497 ----- .../lib/google/cloud/dataproc/v1/jobs_pb.rb | 82 - .../cloud/dataproc/v1/jobs_services_pb.rb | 62 - .../dataproc/v1/node_group_controller.rb | 57 - .../v1/node_group_controller/client.rb | 718 ------- .../v1/node_group_controller/credentials.rb | 51 - .../v1/node_group_controller/operations.rb | 809 -------- .../v1/node_group_controller/paths.rb | 73 - .../dataproc/v1/node_group_controller/rest.rb | 55 - .../v1/node_group_controller/rest/client.rb | 679 ------- .../node_group_controller/rest/operations.rb | 929 --------- .../rest/service_stub.rb | 248 --- .../cloud/dataproc/v1/node_groups_pb.rb | 54 - .../dataproc/v1/node_groups_services_pb.rb | 55 - .../google/cloud/dataproc/v1/operations_pb.rb | 54 - .../lib/google/cloud/dataproc/v1/rest.rb | 45 - .../cloud/dataproc/v1/session_controller.rb | 56 - .../dataproc/v1/session_controller/client.rb | 920 --------- .../v1/session_controller/credentials.rb | 51 - .../v1/session_controller/operations.rb | 809 -------- .../dataproc/v1/session_controller/paths.rb | 107 - .../dataproc/v1/session_controller/rest.rb | 54 - .../v1/session_controller/rest/client.rb | 867 -------- .../v1/session_controller/rest/operations.rb | 929 --------- .../session_controller/rest/service_stub.rb | 366 ---- .../v1/session_template_controller.rb | 55 - .../v1/session_template_controller/client.rb | 830 -------- .../credentials.rb | 51 - .../v1/session_template_controller/paths.rb | 88 - .../v1/session_template_controller/rest.rb | 53 - .../rest/client.rb | 777 -------- .../rest/service_stub.rb | 366 ---- .../cloud/dataproc/v1/session_templates_pb.rb | 60 - .../v1/session_templates_services_pb.rb | 53 - .../google/cloud/dataproc/v1/sessions_pb.rb | 62 - .../cloud/dataproc/v1/sessions_services_pb.rb | 54 - .../lib/google/cloud/dataproc/v1/shared_pb.rb | 71 - .../lib/google/cloud/dataproc/v1/version.rb | 28 - .../dataproc/v1/workflow_template_service.rb | 57 - .../v1/workflow_template_service/client.rb | 1220 ----------- .../workflow_template_service/credentials.rb | 51 - .../workflow_template_service/operations.rb | 809 -------- .../v1/workflow_template_service/paths.rb | 150 -- .../v1/workflow_template_service/rest.rb | 55 - .../workflow_template_service/rest/client.rb | 1153 ----------- .../rest/operations.rb | 929 --------- .../rest/service_stub.rb | 539 ----- .../dataproc/v1/workflow_templates_pb.rb | 79 - .../v1/workflow_templates_services_pb.rb | 105 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 420 ---- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 --- .../cloud/dataproc/v1/autoscaling_policies.rb | 296 --- .../google/cloud/dataproc/v1/batches.rb | 367 ---- .../google/cloud/dataproc/v1/clusters.rb | 1627 --------------- .../google/cloud/dataproc/v1/jobs.rb | 1073 ---------- .../google/cloud/dataproc/v1/node_groups.rb | 115 -- .../google/cloud/dataproc/v1/operations.rb | 260 --- .../cloud/dataproc/v1/session_templates.rb | 153 -- .../google/cloud/dataproc/v1/sessions.rb | 295 --- .../google/cloud/dataproc/v1/shared.rb | 627 ------ .../cloud/dataproc/v1/workflow_templates.rb | 726 ------- .../google/longrunning/operations.rb | 164 -- .../proto_docs/google/protobuf/any.rb | 145 -- .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 --- .../proto_docs/google/protobuf/timestamp.rb | 127 -- .../proto_docs/google/protobuf/wrappers.rb | 121 -- .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../proto_docs/google/type/interval.rb | 45 - .../google-cloud-dataproc-v1/snippets/Gemfile | 32 - .../create_autoscaling_policy.rb | 47 - .../delete_autoscaling_policy.rb | 47 - .../get_autoscaling_policy.rb | 47 - .../list_autoscaling_policies.rb | 51 - .../update_autoscaling_policy.rb | 47 - .../snippets/batch_controller/create_batch.rb | 54 - .../snippets/batch_controller/delete_batch.rb | 47 - .../snippets/batch_controller/get_batch.rb | 47 - .../snippets/batch_controller/list_batches.rb | 51 - .../cluster_controller/create_cluster.rb | 54 - .../cluster_controller/delete_cluster.rb | 54 - .../cluster_controller/diagnose_cluster.rb | 54 - .../cluster_controller/get_cluster.rb | 47 - .../cluster_controller/list_clusters.rb | 51 - .../cluster_controller/start_cluster.rb | 54 - .../cluster_controller/stop_cluster.rb | 54 - .../cluster_controller/update_cluster.rb | 54 - .../snippets/job_controller/cancel_job.rb | 47 - .../snippets/job_controller/delete_job.rb | 47 - .../snippets/job_controller/get_job.rb | 47 - .../snippets/job_controller/list_jobs.rb | 51 - .../snippets/job_controller/submit_job.rb | 47 - .../job_controller/submit_job_as_operation.rb | 54 - .../snippets/job_controller/update_job.rb | 47 - .../create_node_group.rb | 54 - .../node_group_controller/get_node_group.rb | 47 - .../resize_node_group.rb | 54 - .../session_controller/create_session.rb | 54 - .../session_controller/delete_session.rb | 54 - .../session_controller/get_session.rb | 47 - .../session_controller/list_sessions.rb | 51 - .../session_controller/terminate_session.rb | 54 - .../create_session_template.rb | 47 - .../delete_session_template.rb | 47 - .../get_session_template.rb | 47 - .../list_session_templates.rb | 51 - .../update_session_template.rb | 47 - ...pet_metadata_google.cloud.dataproc.v1.json | 1775 ----------------- .../create_workflow_template.rb | 47 - .../delete_workflow_template.rb | 47 - .../get_workflow_template.rb | 47 - .../instantiate_inline_workflow_template.rb | 54 - .../instantiate_workflow_template.rb | 54 - .../list_workflow_templates.rb | 51 - .../update_workflow_template.rb | 47 - .../autoscaling_policy_service_paths_test.rb | 74 - .../autoscaling_policy_service_rest_test.rb | 364 ---- .../v1/autoscaling_policy_service_test.rb | 377 ---- .../v1/batch_controller_operations_test.rb | 389 ---- .../v1/batch_controller_paths_test.rb | 71 - .../dataproc/v1/batch_controller_rest_test.rb | 314 --- .../dataproc/v1/batch_controller_test.rb | 346 ---- .../v1/cluster_controller_operations_test.rb | 389 ---- .../v1/cluster_controller_paths_test.rb | 71 - .../v1/cluster_controller_rest_test.rb | 558 ------ .../dataproc/v1/cluster_controller_test.rb | 659 ------ .../v1/job_controller_operations_test.rb | 389 ---- .../dataproc/v1/job_controller_rest_test.rb | 491 ----- .../cloud/dataproc/v1/job_controller_test.rb | 550 ----- .../node_group_controller_operations_test.rb | 389 ---- .../v1/node_group_controller_paths_test.rb | 59 - .../v1/node_group_controller_rest_test.rb | 259 --- .../dataproc/v1/node_group_controller_test.rb | 286 --- .../v1/session_controller_operations_test.rb | 389 ---- .../v1/session_controller_paths_test.rb | 83 - .../v1/session_controller_rest_test.rb | 369 ---- .../dataproc/v1/session_controller_test.rb | 416 ---- .../session_template_controller_paths_test.rb | 71 - .../session_template_controller_rest_test.rb | 365 ---- .../v1/session_template_controller_test.rb | 379 ---- ...rkflow_template_service_operations_test.rb | 389 ---- .../workflow_template_service_paths_test.rb | 98 - .../v1/workflow_template_service_rest_test.rb | 479 ----- .../v1/workflow_template_service_test.rb | 531 ----- .../google-cloud-dataproc-v1/test/helper.rb | 25 - 210 files changed, 41 insertions(+), 55025 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb index 0fbe426cca92..bb5c54b574a3 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb @@ -1131,7 +1131,7 @@ def list_clusters request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) + # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -1147,6 +1147,9 @@ def list_clusters request, options = nil # Optional. The output Cloud Storage directory for the diagnostic # tarball. If not specified, a task-specific directory in the cluster's # staging bucket will be used. + # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket # @param diagnosis_interval [::Google::Type::Interval, ::Hash] # Optional. Time interval in which diagnosis should be carried out on the # cluster. diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb index 4208d539923d..64d5cabdc98e 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb @@ -1040,7 +1040,7 @@ def list_clusters request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) + # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -1056,6 +1056,9 @@ def list_clusters request, options = nil # Optional. The output Cloud Storage directory for the diagnostic # tarball. If not specified, a task-specific directory in the cluster's # staging bucket will be used. + # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket # @param diagnosis_interval [::Google::Type::Interval, ::Hash] # Optional. Time interval in which diagnosis should be carried out on the # cluster. diff --git a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb index 222b071a3360..723a6669cfa1 100644 --- a/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb +++ b/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb @@ -19,7 +19,7 @@ require 'google/type/interval_pb' -descriptor_data = "\n\'google/cloud/dataproc/v1/clusters.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/dataproc/v1/operations.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1agoogle/type/interval.proto\"\xa2\x04\n\x07\x43luster\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x01\x12S\n\x16virtual_cluster_config\x18\n \x01(\x0b\x32..google.cloud.dataproc.v1.VirtualClusterConfigB\x03\xe0\x41\x01\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32-.google.cloud.dataproc.v1.Cluster.LabelsEntryB\x03\xe0\x41\x01\x12<\n\x06status\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x44\n\x0estatus_history\x18\x07 \x03(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x07metrics\x18\t \x01(\x0b\x32(.google.cloud.dataproc.v1.ClusterMetricsB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\t\n\rClusterConfig\x12\x1a\n\rconfig_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0btemp_bucket\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12K\n\x12gce_cluster_config\x18\x08 \x01(\x0b\x32*.google.cloud.dataproc.v1.GceClusterConfigB\x03\xe0\x41\x01\x12I\n\rmaster_config\x18\t \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12I\n\rworker_config\x18\n \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12S\n\x17secondary_worker_config\x18\x0c \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsoftware_config\x18\r \x01(\x0b\x32(.google.cloud.dataproc.v1.SoftwareConfigB\x03\xe0\x41\x01\x12W\n\x16initialization_actions\x18\x0b \x03(\x0b\x32\x32.google.cloud.dataproc.v1.NodeInitializationActionB\x03\xe0\x41\x01\x12J\n\x11\x65ncryption_config\x18\x0f \x01(\x0b\x32*.google.cloud.dataproc.v1.EncryptionConfigB\x03\xe0\x41\x01\x12L\n\x12\x61utoscaling_config\x18\x12 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsecurity_config\x18\x10 \x01(\x0b\x32(.google.cloud.dataproc.v1.SecurityConfigB\x03\xe0\x41\x01\x12H\n\x10lifecycle_config\x18\x11 \x01(\x0b\x32).google.cloud.dataproc.v1.LifecycleConfigB\x03\xe0\x41\x01\x12\x46\n\x0f\x65ndpoint_config\x18\x13 \x01(\x0b\x32(.google.cloud.dataproc.v1.EndpointConfigB\x03\xe0\x41\x01\x12H\n\x10metastore_config\x18\x14 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12S\n\x16\x64\x61taproc_metric_config\x18\x17 \x01(\x0b\x32..google.cloud.dataproc.v1.DataprocMetricConfigB\x03\xe0\x41\x01\x12P\n\x15\x61uxiliary_node_groups\x18\x19 \x03(\x0b\x32,.google.cloud.dataproc.v1.AuxiliaryNodeGroupB\x03\xe0\x41\x01\"\x84\x02\n\x14VirtualClusterConfig\x12\x1b\n\x0estaging_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12[\n\x19kubernetes_cluster_config\x18\x06 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.KubernetesClusterConfigB\x03\xe0\x41\x02H\x00\x12Y\n\x19\x61uxiliary_services_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.AuxiliaryServicesConfigB\x03\xe0\x41\x01\x42\x17\n\x15infrastructure_config\"\xc1\x01\n\x17\x41uxiliaryServicesConfig\x12H\n\x10metastore_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xba\x01\n\x0e\x45ndpointConfig\x12P\n\nhttp_ports\x18\x01 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.EndpointConfig.HttpPortsEntryB\x03\xe0\x41\x03\x12$\n\x17\x65nable_http_port_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x30\n\x0eHttpPortsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\",\n\x11\x41utoscalingConfig\x12\x17\n\npolicy_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\"4\n\x10\x45ncryptionConfig\x12 \n\x13gce_pd_kms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xba\x07\n\x10GceClusterConfig\x12\x15\n\x08zone_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bnetwork_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0esubnetwork_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x10internal_ip_only\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12k\n\x1aprivate_ipv6_google_access\x18\x0c \x01(\x0e\x32\x42.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccessB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12O\n\x08metadata\x18\x05 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.GceClusterConfig.MetadataEntryB\x03\xe0\x41\x01\x12P\n\x14reservation_affinity\x18\x0b \x01(\x0b\x32-.google.cloud.dataproc.v1.ReservationAffinityB\x03\xe0\x41\x01\x12M\n\x13node_group_affinity\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.NodeGroupAffinityB\x03\xe0\x41\x01\x12W\n\x18shielded_instance_config\x18\x0e \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12_\n\x1c\x63onfidential_instance_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.dataproc.v1.ConfidentialInstanceConfigB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x01\n\x17PrivateIpv6GoogleAccess\x12*\n&PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED\x10\x00\x12\x1b\n\x17INHERIT_FROM_SUBNETWORK\x10\x01\x12\x0c\n\x08OUTBOUND\x10\x02\x12\x11\n\rBIDIRECTIONAL\x10\x03\x42\x13\n\x11_internal_ip_only\"0\n\x11NodeGroupAffinity\x12\x1b\n\x0enode_group_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xd3\x01\n\x16ShieldedInstanceConfig\x12$\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12-\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13_enable_secure_bootB\x0e\n\x0c_enable_vtpmB\x1e\n\x1c_enable_integrity_monitoring\"F\n\x1a\x43onfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x06\n\x13InstanceGroupConfig\x12\x1a\n\rnum_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0einstance_names\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12M\n\x13instance_references\x18\x0b \x03(\x0b\x32+.google.cloud.dataproc.v1.InstanceReferenceB\x03\xe0\x41\x03\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10machine_type_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0b\x64isk_config\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.DiskConfigB\x03\xe0\x41\x01\x12\x1b\n\x0eis_preemptible\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x0epreemptibility\x18\n \x01(\x0e\x32<.google.cloud.dataproc.v1.InstanceGroupConfig.PreemptibilityB\x03\xe0\x41\x01\x12O\n\x14managed_group_config\x18\x07 \x01(\x0b\x32,.google.cloud.dataproc.v1.ManagedGroupConfigB\x03\xe0\x41\x03\x12\x46\n\x0c\x61\x63\x63\x65lerators\x18\x08 \x03(\x0b\x32+.google.cloud.dataproc.v1.AcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11min_num_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12]\n\x1binstance_flexibility_policy\x18\r \x01(\x0b\x32\x33.google.cloud.dataproc.v1.InstanceFlexibilityPolicyB\x03\xe0\x41\x01\x12\x44\n\x0estartup_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.StartupConfigB\x03\xe0\x41\x01\"`\n\x0ePreemptibility\x12\x1e\n\x1aPREEMPTIBILITY_UNSPECIFIED\x10\x00\x12\x13\n\x0fNON_PREEMPTIBLE\x10\x01\x12\x0f\n\x0bPREEMPTIBLE\x10\x02\x12\x08\n\x04SPOT\x10\x03\"d\n\rStartupConfig\x12\x30\n\x1erequired_registration_fraction\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42!\n\x1f_required_registration_fraction\"m\n\x11InstanceReference\x12\x15\n\rinstance_name\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x12\n\npublic_key\x18\x03 \x01(\t\x12\x18\n\x10public_ecies_key\x18\x04 \x01(\t\"\x8c\x01\n\x12ManagedGroupConfig\x12#\n\x16instance_template_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12(\n\x1binstance_group_manager_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1ainstance_group_manager_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xb7\x03\n\x19InstanceFlexibilityPolicy\x12k\n\x17instance_selection_list\x18\x02 \x03(\x0b\x32\x45.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionB\x03\xe0\x41\x01\x12t\n\x1ainstance_selection_results\x18\x03 \x03(\x0b\x32K.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResultB\x03\xe0\x41\x03\x1a\x42\n\x11InstanceSelection\x12\x1a\n\rmachine_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04rank\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1as\n\x17InstanceSelectionResult\x12\x1e\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\x08vm_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x0f\n\r_machine_typeB\x0b\n\t_vm_count\"L\n\x11\x41\x63\x63\x65leratorConfig\x12\x1c\n\x14\x61\x63\x63\x65lerator_type_uri\x18\x01 \x01(\t\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x02 \x01(\x05\"\x88\x01\n\nDiskConfig\x12\x1b\n\x0e\x62oot_disk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0enum_local_ssds\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13local_ssd_interface\x18\x04 \x01(\tB\x03\xe0\x41\x01\"n\n\x12\x41uxiliaryNodeGroup\x12<\n\nnode_group\x18\x01 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbd\x03\n\tNodeGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05roles\x18\x02 \x03(\x0e\x32(.google.cloud.dataproc.v1.NodeGroup.RoleB\x03\xe0\x41\x02\x12M\n\x11node_group_config\x18\x03 \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.dataproc.v1.NodeGroup.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"(\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44RIVER\x10\x01:v\xea\x41s\n!dataproc.googleapis.com/NodeGroup\x12Nprojects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}\"s\n\x18NodeInitializationAction\x12\x1c\n\x0f\x65xecutable_file\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x11\x65xecution_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xd6\x03\n\rClusterStatus\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32-.google.cloud.dataproc.v1.ClusterStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x06\x64\x65tail\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08substate\x18\x04 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.ClusterStatus.SubstateB\x03\xe0\x41\x03\"\xa7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x17\n\x13\x45RROR_DUE_TO_UPDATE\x10\t\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0c\n\x08UPDATING\x10\x05\x12\x0c\n\x08STOPPING\x10\x06\x12\x0b\n\x07STOPPED\x10\x07\x12\x0c\n\x08STARTING\x10\x08\x12\r\n\tREPAIRING\x10\n\"<\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tUNHEALTHY\x10\x01\x12\x10\n\x0cSTALE_STATUS\x10\x02\"\xa0\x01\n\x0eSecurityConfig\x12\x46\n\x0fkerberos_config\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.KerberosConfigB\x03\xe0\x41\x01\x12\x46\n\x0fidentity_config\x18\x02 \x01(\x0b\x32(.google.cloud.dataproc.v1.IdentityConfigB\x03\xe0\x41\x01\"\x90\x04\n\x0eKerberosConfig\x12\x1c\n\x0f\x65nable_kerberos\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1broot_principal_password_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bkms_key_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0ckeystore_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0etruststore_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15keystore_password_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10key_password_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17truststore_password_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x63ross_realm_trust_realm\x18\t \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15\x63ross_realm_trust_kdc\x18\n \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x63ross_realm_trust_admin_server\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12\x32\n%cross_realm_trust_shared_password_uri\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ekdc_db_key_uri\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12tgt_lifetime_hours\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05realm\x18\x0f \x01(\tB\x03\xe0\x41\x01\"\xc6\x01\n\x0eIdentityConfig\x12r\n\x1cuser_service_account_mapping\x18\x01 \x03(\x0b\x32G.google.cloud.dataproc.v1.IdentityConfig.UserServiceAccountMappingEntryB\x03\xe0\x41\x02\x1a@\n\x1eUserServiceAccountMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf9\x01\n\x0eSoftwareConfig\x12\x1a\n\rimage_version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.SoftwareConfig.PropertiesEntryB\x03\xe0\x41\x01\x12\x45\n\x13optional_components\x18\x03 \x03(\x0e\x32#.google.cloud.dataproc.v1.ComponentB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x02\n\x0fLifecycleConfig\x12\x37\n\x0fidle_delete_ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12;\n\x10\x61uto_delete_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12\x39\n\x0f\x61uto_delete_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x38\n\x0fidle_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x05\n\x03ttl\"_\n\x0fMetastoreConfig\x12L\n\x1a\x64\x61taproc_metastore_service\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n metastore.googleapis.com/Service\"\x9a\x02\n\x0e\x43lusterMetrics\x12O\n\x0chdfs_metrics\x18\x01 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.HdfsMetricsEntry\x12O\n\x0cyarn_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.YarnMetricsEntry\x1a\x32\n\x10HdfsMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10YarnMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\x92\x03\n\x14\x44\x61taprocMetricConfig\x12K\n\x07metrics\x18\x01 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.DataprocMetricConfig.MetricB\x03\xe0\x41\x02\x1a\x80\x01\n\x06Metric\x12W\n\rmetric_source\x18\x01 \x01(\x0e\x32;.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSourceB\x03\xe0\x41\x02\x12\x1d\n\x10metric_overrides\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xa9\x01\n\x0cMetricSource\x12\x1d\n\x19METRIC_SOURCE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MONITORING_AGENT_DEFAULTS\x10\x01\x12\x08\n\x04HDFS\x10\x02\x12\t\n\x05SPARK\x10\x03\x12\x08\n\x04YARN\x10\x04\x12\x18\n\x14SPARK_HISTORY_SERVER\x10\x05\x12\x0f\n\x0bHIVESERVER2\x10\x06\x12\x11\n\rHIVEMETASTORE\x10\x07\"\xee\x01\n\x14\x43reateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12V\n action_on_failed_primary_workers\x18\x05 \x01(\x0e\x32\'.google.cloud.dataproc.v1.FailureActionB\x03\xe0\x41\x01\"\xae\x02\n\x14UpdateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x45\n\x1dgraceful_decommission_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x12StopClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x92\x01\n\x13StartClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x14\x44\x65leteClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\\\n\x11GetClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x89\x01\n\x13ListClustersRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"n\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xed\x01\n\x16\x44iagnoseClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarball_gcs_dir\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x36\n\x12\x64iagnosis_interval\x18\x06 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x01\x12\x11\n\x04jobs\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14yarn_application_ids\x18\x0b \x03(\tB\x03\xe0\x41\x01\"1\n\x16\x44iagnoseClusterResults\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xf8\x01\n\x13ReservationAffinity\x12Y\n\x18\x63onsume_reservation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dataproc.v1.ReservationAffinity.TypeB\x03\xe0\x41\x01\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x32\xe4\x10\n\x11\x43lusterController\x12\x80\x02\n\rCreateCluster\x12..google.cloud.dataproc.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x19project_id,region,cluster\x82\xd3\xe4\x93\x02>\"3/v1/projects/{project_id}/regions/{region}/clusters:\x07\x63luster\x12\xa8\x02\n\rUpdateCluster\x12..google.cloud.dataproc.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x32project_id,region,cluster_name,cluster,update_mask\x82\xd3\xe4\x93\x02M2B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:\x07\x63luster\x12\xee\x01\n\x0bStopCluster\x12,.google.cloud.dataproc.v1.StopClusterRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02L\"G/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop:\x01*\x12\xf1\x01\n\x0cStartCluster\x12-.google.cloud.dataproc.v1.StartClusterRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02M\"H/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start:\x01*\x12\x99\x02\n\rDeleteCluster\x12..google.cloud.dataproc.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44*B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xc9\x01\n\nGetCluster\x12+.google.cloud.dataproc.v1.GetClusterRequest\x1a!.google.cloud.dataproc.v1.Cluster\"k\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xd9\x01\n\x0cListClusters\x12-.google.cloud.dataproc.v1.ListClustersRequest\x1a..google.cloud.dataproc.v1.ListClustersResponse\"j\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/projects/{project_id}/regions/{region}/clusters\x12\xaa\x02\n\x0f\x44iagnoseCluster\x12\x30.google.cloud.dataproc.v1.DiagnoseClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41K\n\x16\x44iagnoseClusterResults\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02P\"K/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose:\x01*\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rClustersProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" +descriptor_data = "\n\'google/cloud/dataproc/v1/clusters.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/dataproc/v1/operations.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1agoogle/type/interval.proto\"\xa2\x04\n\x07\x43luster\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x01\x12S\n\x16virtual_cluster_config\x18\n \x01(\x0b\x32..google.cloud.dataproc.v1.VirtualClusterConfigB\x03\xe0\x41\x01\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32-.google.cloud.dataproc.v1.Cluster.LabelsEntryB\x03\xe0\x41\x01\x12<\n\x06status\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x44\n\x0estatus_history\x18\x07 \x03(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x07metrics\x18\t \x01(\x0b\x32(.google.cloud.dataproc.v1.ClusterMetricsB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\t\n\rClusterConfig\x12\x1a\n\rconfig_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0btemp_bucket\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12K\n\x12gce_cluster_config\x18\x08 \x01(\x0b\x32*.google.cloud.dataproc.v1.GceClusterConfigB\x03\xe0\x41\x01\x12I\n\rmaster_config\x18\t \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12I\n\rworker_config\x18\n \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12S\n\x17secondary_worker_config\x18\x0c \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsoftware_config\x18\r \x01(\x0b\x32(.google.cloud.dataproc.v1.SoftwareConfigB\x03\xe0\x41\x01\x12W\n\x16initialization_actions\x18\x0b \x03(\x0b\x32\x32.google.cloud.dataproc.v1.NodeInitializationActionB\x03\xe0\x41\x01\x12J\n\x11\x65ncryption_config\x18\x0f \x01(\x0b\x32*.google.cloud.dataproc.v1.EncryptionConfigB\x03\xe0\x41\x01\x12L\n\x12\x61utoscaling_config\x18\x12 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsecurity_config\x18\x10 \x01(\x0b\x32(.google.cloud.dataproc.v1.SecurityConfigB\x03\xe0\x41\x01\x12H\n\x10lifecycle_config\x18\x11 \x01(\x0b\x32).google.cloud.dataproc.v1.LifecycleConfigB\x03\xe0\x41\x01\x12\x46\n\x0f\x65ndpoint_config\x18\x13 \x01(\x0b\x32(.google.cloud.dataproc.v1.EndpointConfigB\x03\xe0\x41\x01\x12H\n\x10metastore_config\x18\x14 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12S\n\x16\x64\x61taproc_metric_config\x18\x17 \x01(\x0b\x32..google.cloud.dataproc.v1.DataprocMetricConfigB\x03\xe0\x41\x01\x12P\n\x15\x61uxiliary_node_groups\x18\x19 \x03(\x0b\x32,.google.cloud.dataproc.v1.AuxiliaryNodeGroupB\x03\xe0\x41\x01\"\x84\x02\n\x14VirtualClusterConfig\x12\x1b\n\x0estaging_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12[\n\x19kubernetes_cluster_config\x18\x06 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.KubernetesClusterConfigB\x03\xe0\x41\x02H\x00\x12Y\n\x19\x61uxiliary_services_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.AuxiliaryServicesConfigB\x03\xe0\x41\x01\x42\x17\n\x15infrastructure_config\"\xc1\x01\n\x17\x41uxiliaryServicesConfig\x12H\n\x10metastore_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xba\x01\n\x0e\x45ndpointConfig\x12P\n\nhttp_ports\x18\x01 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.EndpointConfig.HttpPortsEntryB\x03\xe0\x41\x03\x12$\n\x17\x65nable_http_port_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x30\n\x0eHttpPortsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\",\n\x11\x41utoscalingConfig\x12\x17\n\npolicy_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\"4\n\x10\x45ncryptionConfig\x12 \n\x13gce_pd_kms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xba\x07\n\x10GceClusterConfig\x12\x15\n\x08zone_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bnetwork_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0esubnetwork_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x10internal_ip_only\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12k\n\x1aprivate_ipv6_google_access\x18\x0c \x01(\x0e\x32\x42.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccessB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12O\n\x08metadata\x18\x05 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.GceClusterConfig.MetadataEntryB\x03\xe0\x41\x01\x12P\n\x14reservation_affinity\x18\x0b \x01(\x0b\x32-.google.cloud.dataproc.v1.ReservationAffinityB\x03\xe0\x41\x01\x12M\n\x13node_group_affinity\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.NodeGroupAffinityB\x03\xe0\x41\x01\x12W\n\x18shielded_instance_config\x18\x0e \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12_\n\x1c\x63onfidential_instance_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.dataproc.v1.ConfidentialInstanceConfigB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x01\n\x17PrivateIpv6GoogleAccess\x12*\n&PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED\x10\x00\x12\x1b\n\x17INHERIT_FROM_SUBNETWORK\x10\x01\x12\x0c\n\x08OUTBOUND\x10\x02\x12\x11\n\rBIDIRECTIONAL\x10\x03\x42\x13\n\x11_internal_ip_only\"0\n\x11NodeGroupAffinity\x12\x1b\n\x0enode_group_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xd3\x01\n\x16ShieldedInstanceConfig\x12$\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12-\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13_enable_secure_bootB\x0e\n\x0c_enable_vtpmB\x1e\n\x1c_enable_integrity_monitoring\"F\n\x1a\x43onfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x06\n\x13InstanceGroupConfig\x12\x1a\n\rnum_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0einstance_names\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12M\n\x13instance_references\x18\x0b \x03(\x0b\x32+.google.cloud.dataproc.v1.InstanceReferenceB\x03\xe0\x41\x03\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10machine_type_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0b\x64isk_config\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.DiskConfigB\x03\xe0\x41\x01\x12\x1b\n\x0eis_preemptible\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x0epreemptibility\x18\n \x01(\x0e\x32<.google.cloud.dataproc.v1.InstanceGroupConfig.PreemptibilityB\x03\xe0\x41\x01\x12O\n\x14managed_group_config\x18\x07 \x01(\x0b\x32,.google.cloud.dataproc.v1.ManagedGroupConfigB\x03\xe0\x41\x03\x12\x46\n\x0c\x61\x63\x63\x65lerators\x18\x08 \x03(\x0b\x32+.google.cloud.dataproc.v1.AcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11min_num_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12]\n\x1binstance_flexibility_policy\x18\r \x01(\x0b\x32\x33.google.cloud.dataproc.v1.InstanceFlexibilityPolicyB\x03\xe0\x41\x01\x12\x44\n\x0estartup_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.StartupConfigB\x03\xe0\x41\x01\"`\n\x0ePreemptibility\x12\x1e\n\x1aPREEMPTIBILITY_UNSPECIFIED\x10\x00\x12\x13\n\x0fNON_PREEMPTIBLE\x10\x01\x12\x0f\n\x0bPREEMPTIBLE\x10\x02\x12\x08\n\x04SPOT\x10\x03\"d\n\rStartupConfig\x12\x30\n\x1erequired_registration_fraction\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42!\n\x1f_required_registration_fraction\"m\n\x11InstanceReference\x12\x15\n\rinstance_name\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x12\n\npublic_key\x18\x03 \x01(\t\x12\x18\n\x10public_ecies_key\x18\x04 \x01(\t\"\x8c\x01\n\x12ManagedGroupConfig\x12#\n\x16instance_template_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12(\n\x1binstance_group_manager_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1ainstance_group_manager_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xb7\x03\n\x19InstanceFlexibilityPolicy\x12k\n\x17instance_selection_list\x18\x02 \x03(\x0b\x32\x45.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionB\x03\xe0\x41\x01\x12t\n\x1ainstance_selection_results\x18\x03 \x03(\x0b\x32K.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResultB\x03\xe0\x41\x03\x1a\x42\n\x11InstanceSelection\x12\x1a\n\rmachine_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04rank\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1as\n\x17InstanceSelectionResult\x12\x1e\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\x08vm_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x0f\n\r_machine_typeB\x0b\n\t_vm_count\"L\n\x11\x41\x63\x63\x65leratorConfig\x12\x1c\n\x14\x61\x63\x63\x65lerator_type_uri\x18\x01 \x01(\t\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x02 \x01(\x05\"\x88\x01\n\nDiskConfig\x12\x1b\n\x0e\x62oot_disk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0enum_local_ssds\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13local_ssd_interface\x18\x04 \x01(\tB\x03\xe0\x41\x01\"n\n\x12\x41uxiliaryNodeGroup\x12<\n\nnode_group\x18\x01 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbd\x03\n\tNodeGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05roles\x18\x02 \x03(\x0e\x32(.google.cloud.dataproc.v1.NodeGroup.RoleB\x03\xe0\x41\x02\x12M\n\x11node_group_config\x18\x03 \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.dataproc.v1.NodeGroup.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"(\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44RIVER\x10\x01:v\xea\x41s\n!dataproc.googleapis.com/NodeGroup\x12Nprojects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}\"s\n\x18NodeInitializationAction\x12\x1c\n\x0f\x65xecutable_file\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x11\x65xecution_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xd6\x03\n\rClusterStatus\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32-.google.cloud.dataproc.v1.ClusterStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x06\x64\x65tail\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08substate\x18\x04 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.ClusterStatus.SubstateB\x03\xe0\x41\x03\"\xa7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x17\n\x13\x45RROR_DUE_TO_UPDATE\x10\t\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0c\n\x08UPDATING\x10\x05\x12\x0c\n\x08STOPPING\x10\x06\x12\x0b\n\x07STOPPED\x10\x07\x12\x0c\n\x08STARTING\x10\x08\x12\r\n\tREPAIRING\x10\n\"<\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tUNHEALTHY\x10\x01\x12\x10\n\x0cSTALE_STATUS\x10\x02\"\xa0\x01\n\x0eSecurityConfig\x12\x46\n\x0fkerberos_config\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.KerberosConfigB\x03\xe0\x41\x01\x12\x46\n\x0fidentity_config\x18\x02 \x01(\x0b\x32(.google.cloud.dataproc.v1.IdentityConfigB\x03\xe0\x41\x01\"\x90\x04\n\x0eKerberosConfig\x12\x1c\n\x0f\x65nable_kerberos\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1broot_principal_password_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bkms_key_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0ckeystore_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0etruststore_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15keystore_password_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10key_password_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17truststore_password_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x63ross_realm_trust_realm\x18\t \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15\x63ross_realm_trust_kdc\x18\n \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x63ross_realm_trust_admin_server\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12\x32\n%cross_realm_trust_shared_password_uri\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ekdc_db_key_uri\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12tgt_lifetime_hours\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05realm\x18\x0f \x01(\tB\x03\xe0\x41\x01\"\xc6\x01\n\x0eIdentityConfig\x12r\n\x1cuser_service_account_mapping\x18\x01 \x03(\x0b\x32G.google.cloud.dataproc.v1.IdentityConfig.UserServiceAccountMappingEntryB\x03\xe0\x41\x02\x1a@\n\x1eUserServiceAccountMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf9\x01\n\x0eSoftwareConfig\x12\x1a\n\rimage_version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.SoftwareConfig.PropertiesEntryB\x03\xe0\x41\x01\x12\x45\n\x13optional_components\x18\x03 \x03(\x0e\x32#.google.cloud.dataproc.v1.ComponentB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x02\n\x0fLifecycleConfig\x12\x37\n\x0fidle_delete_ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12;\n\x10\x61uto_delete_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12\x39\n\x0f\x61uto_delete_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x38\n\x0fidle_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x05\n\x03ttl\"_\n\x0fMetastoreConfig\x12L\n\x1a\x64\x61taproc_metastore_service\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n metastore.googleapis.com/Service\"\x9a\x02\n\x0e\x43lusterMetrics\x12O\n\x0chdfs_metrics\x18\x01 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.HdfsMetricsEntry\x12O\n\x0cyarn_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.YarnMetricsEntry\x1a\x32\n\x10HdfsMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10YarnMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\x92\x03\n\x14\x44\x61taprocMetricConfig\x12K\n\x07metrics\x18\x01 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.DataprocMetricConfig.MetricB\x03\xe0\x41\x02\x1a\x80\x01\n\x06Metric\x12W\n\rmetric_source\x18\x01 \x01(\x0e\x32;.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSourceB\x03\xe0\x41\x02\x12\x1d\n\x10metric_overrides\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xa9\x01\n\x0cMetricSource\x12\x1d\n\x19METRIC_SOURCE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MONITORING_AGENT_DEFAULTS\x10\x01\x12\x08\n\x04HDFS\x10\x02\x12\t\n\x05SPARK\x10\x03\x12\x08\n\x04YARN\x10\x04\x12\x18\n\x14SPARK_HISTORY_SERVER\x10\x05\x12\x0f\n\x0bHIVESERVER2\x10\x06\x12\x11\n\rHIVEMETASTORE\x10\x07\"\xee\x01\n\x14\x43reateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12V\n action_on_failed_primary_workers\x18\x05 \x01(\x0e\x32\'.google.cloud.dataproc.v1.FailureActionB\x03\xe0\x41\x01\"\xae\x02\n\x14UpdateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x45\n\x1dgraceful_decommission_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x12StopClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x92\x01\n\x13StartClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x14\x44\x65leteClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\\\n\x11GetClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x89\x01\n\x13ListClustersRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"n\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xb3\x03\n\x16\x44iagnoseClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarball_gcs_dir\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0etarball_access\x18\x05 \x01(\x0e\x32>.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccessB\x03\xe0\x41\x01\x12\x36\n\x12\x64iagnosis_interval\x18\x06 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x01\x12\x11\n\x04jobs\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14yarn_application_ids\x18\x0b \x03(\tB\x03\xe0\x41\x01\"g\n\rTarballAccess\x12\x1e\n\x1aTARBALL_ACCESS_UNSPECIFIED\x10\x00\x12\x18\n\x14GOOGLE_CLOUD_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_DATAPROC_DIAGNOSE\x10\x02\"1\n\x16\x44iagnoseClusterResults\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xf8\x01\n\x13ReservationAffinity\x12Y\n\x18\x63onsume_reservation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dataproc.v1.ReservationAffinity.TypeB\x03\xe0\x41\x01\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x32\xe4\x10\n\x11\x43lusterController\x12\x80\x02\n\rCreateCluster\x12..google.cloud.dataproc.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x19project_id,region,cluster\x82\xd3\xe4\x93\x02>\"3/v1/projects/{project_id}/regions/{region}/clusters:\x07\x63luster\x12\xa8\x02\n\rUpdateCluster\x12..google.cloud.dataproc.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x32project_id,region,cluster_name,cluster,update_mask\x82\xd3\xe4\x93\x02M2B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:\x07\x63luster\x12\xee\x01\n\x0bStopCluster\x12,.google.cloud.dataproc.v1.StopClusterRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02L\"G/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop:\x01*\x12\xf1\x01\n\x0cStartCluster\x12-.google.cloud.dataproc.v1.StartClusterRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02M\"H/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start:\x01*\x12\x99\x02\n\rDeleteCluster\x12..google.cloud.dataproc.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44*B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xc9\x01\n\nGetCluster\x12+.google.cloud.dataproc.v1.GetClusterRequest\x1a!.google.cloud.dataproc.v1.Cluster\"k\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xd9\x01\n\x0cListClusters\x12-.google.cloud.dataproc.v1.ListClustersRequest\x1a..google.cloud.dataproc.v1.ListClustersResponse\"j\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/projects/{project_id}/regions/{region}/clusters\x12\xaa\x02\n\x0f\x44iagnoseCluster\x12\x30.google.cloud.dataproc.v1.DiagnoseClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41K\n\x16\x44iagnoseClusterResults\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02P\"K/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose:\x01*\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rClustersProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -102,6 +102,7 @@ module V1 ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersRequest").msgclass ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersResponse").msgclass DiagnoseClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest").msgclass + DiagnoseClusterRequest::TarballAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess").enummodule DiagnoseClusterResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterResults").msgclass ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity").msgclass ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity.Type").enummodule diff --git a/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb b/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb index 7ddd6ff361dc..9c920e13eb94 100644 --- a/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb +++ b/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb @@ -1546,6 +1546,10 @@ class ListClustersResponse # Optional. The output Cloud Storage directory for the diagnostic # tarball. If not specified, a task-specific directory in the cluster's # staging bucket will be used. + # @!attribute [rw] tarball_access + # @return [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] + # Optional. (Optional) The access type to the diagnostic tarball. If not + # specified, falls back to default access of the bucket # @!attribute [rw] diagnosis_interval # @return [::Google::Type::Interval] # Optional. Time interval in which diagnosis should be carried out on the @@ -1561,6 +1565,20 @@ class ListClustersResponse class DiagnoseClusterRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines who has access to the diagnostic tarball + module TarballAccess + # Tarball Access unspecified. Falls back to default access of the bucket + TARBALL_ACCESS_UNSPECIFIED = 0 + + # Google Cloud Support group has read access to the + # diagnostic tarball + GOOGLE_CLOUD_SUPPORT = 1 + + # Google Cloud Dataproc Diagnose service account has read access to the + # diagnostic tarball + GOOGLE_DATAPROC_DIAGNOSE = 2 + end end # The location of diagnostic output. diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb index 307b23b4290d..0c713847a9d3 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb @@ -488,6 +488,7 @@ def test_diagnose_cluster region = "hello world" cluster_name = "hello world" tarball_gcs_dir = "hello world" + tarball_access = :TARBALL_ACCESS_UNSPECIFIED diagnosis_interval = {} jobs = ["hello world"] yarn_application_ids = ["hello world"] @@ -506,27 +507,27 @@ def test_diagnose_cluster end # Use hash object - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response| + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response| + client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response| + client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response| + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response| + client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response| assert_equal http_response, response.underlying_op end diff --git a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb index e087b024550c..7291ec9997d6 100644 --- a/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb +++ b/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb @@ -559,6 +559,7 @@ def test_diagnose_cluster region = "hello world" cluster_name = "hello world" tarball_gcs_dir = "hello world" + tarball_access = :TARBALL_ACCESS_UNSPECIFIED diagnosis_interval = {} jobs = ["hello world"] yarn_application_ids = ["hello world"] @@ -570,6 +571,7 @@ def test_diagnose_cluster assert_equal "hello world", request["region"] assert_equal "hello world", request["cluster_name"] assert_equal "hello world", request["tarball_gcs_dir"] + assert_equal :TARBALL_ACCESS_UNSPECIFIED, request["tarball_access"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Type::Interval), request["diagnosis_interval"] assert_equal ["hello world"], request["jobs"] assert_equal ["hello world"], request["yarn_application_ids"] @@ -583,35 +585,35 @@ def test_diagnose_cluster end # Use hash object - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation| + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use named arguments - client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation| + client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object - client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation| + client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use hash object with options - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation| + client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object with options - client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation| + client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.gitignore b/owl-bot-staging/google-cloud-dataproc-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json deleted file mode 100644 index 4ed167b07e25..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "dataproc.googleapis.com", - "api_shortname": "dataproc", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dataproc-v1/latest", - "distribution_name": "google-cloud-dataproc-v1", - "is_cloud": true, - "language": "ruby", - "name": "dataproc", - "name_pretty": "Cloud Dataproc V1 API", - "product_documentation": "https://cloud.google.com/dataproc", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages Hadoop-based clusters and jobs on Google Cloud Platform. Note that google-cloud-dataproc-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dataproc instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DATAPROC", - "ruby-cloud-product-url": "https://cloud.google.com/dataproc", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml b/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml deleted file mode 100644 index 3233e39a8e32..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-dataproc-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-dataproc-v1.rb" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb b/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/.yardopts b/owl-bot-staging/google-cloud-dataproc-v1/.yardopts deleted file mode 100644 index dda36bca10e2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Dataproc V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md deleted file mode 100644 index bba581ee7b23..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-dataproc-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-dataproc-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/dataproc/v1" - -client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/dataproc/v1" - -::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-dataproc-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/dataproc/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-dataproc-v1/Gemfile b/owl-bot-staging/google-cloud-dataproc-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md b/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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 - - http://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. diff --git a/owl-bot-staging/google-cloud-dataproc-v1/README.md b/owl-bot-staging/google-cloud-dataproc-v1/README.md deleted file mode 100644 index 5ed2111d2a8b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# Ruby Client for the Cloud Dataproc V1 API - -Manages Hadoop-based clusters and jobs on Google Cloud Platform. - - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Cloud Dataproc V1 API. Most users should consider using -the main client gem, -[google-cloud-dataproc](https://rubygems.org/gems/google-cloud-dataproc). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-dataproc-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/dataproc.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/dataproc/v1" - -client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -request = ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new # (request fields as keyword arguments...) -response = client.create_autoscaling_policy request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dataproc-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/dataproc) -for general usage information. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.7+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-dataproc`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-dataproc-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-dataproc`. -The main client is recommended because it will embody the best practices for -accessing the service, and may also provide more convenient interfaces or -tighter integration into frameworks and third-party libraries. In addition, the -documentation and samples published by Google will generally demonstrate use of -the main client. - -### Why would I want to use a versioned client? - -You can use a versioned client if you are content with a possibly lower-level -class interface, you explicitly want to avoid features provided by the main -client, or you want to access a specific service version not be covered by the -main client. You can identify versioned client gems because the service version -is part of the name, e.g. `google-cloud-dataproc-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-dataproc-v1/Rakefile b/owl-bot-staging/google-cloud-dataproc-v1/Rakefile deleted file mode 100644 index 46fba621c6ef..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-dataproc-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["DATAPROC_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["DATAPROC_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["DATAPROC_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or DATAPROC_TEST_PROJECT=test123 DATAPROC_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/dataproc/v1/autoscaling_policy_service/credentials" - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["DATAPROC_PROJECT"] = project - ENV["DATAPROC_TEST_PROJECT"] = project - ENV["DATAPROC_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-dataproc-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-dataproc-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-dataproc-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-dataproc-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-dataproc-v1" - header "google-cloud-dataproc-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-dataproc-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-dataproc-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-dataproc-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-dataproc-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json deleted file mode 100644 index 206ae3b0a44b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/gapic_metadata.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.dataproc.v1", - "libraryPackage": "::Google::Cloud::Dataproc::V1", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ - "create_autoscaling_policy" - ] - }, - "UpdateAutoscalingPolicy": { - "methods": [ - "update_autoscaling_policy" - ] - }, - "GetAutoscalingPolicy": { - "methods": [ - "get_autoscaling_policy" - ] - }, - "ListAutoscalingPolicies": { - "methods": [ - "list_autoscaling_policies" - ] - }, - "DeleteAutoscalingPolicy": { - "methods": [ - "delete_autoscaling_policy" - ] - } - } - } - } - }, - "BatchController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::BatchController::Client", - "rpcs": { - "CreateBatch": { - "methods": [ - "create_batch" - ] - }, - "GetBatch": { - "methods": [ - "get_batch" - ] - }, - "ListBatches": { - "methods": [ - "list_batches" - ] - }, - "DeleteBatch": { - "methods": [ - "delete_batch" - ] - } - } - } - } - }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::ClusterController::Client", - "rpcs": { - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "StopCluster": { - "methods": [ - "stop_cluster" - ] - }, - "StartCluster": { - "methods": [ - "start_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "DiagnoseCluster": { - "methods": [ - "diagnose_cluster" - ] - } - } - } - } - }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::JobController::Client", - "rpcs": { - "SubmitJob": { - "methods": [ - "submit_job" - ] - }, - "SubmitJobAsOperation": { - "methods": [ - "submit_job_as_operation" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "UpdateJob": { - "methods": [ - "update_job" - ] - }, - "CancelJob": { - "methods": [ - "cancel_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - } - } - } - } - }, - "NodeGroupController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client", - "rpcs": { - "CreateNodeGroup": { - "methods": [ - "create_node_group" - ] - }, - "ResizeNodeGroup": { - "methods": [ - "resize_node_group" - ] - }, - "GetNodeGroup": { - "methods": [ - "get_node_group" - ] - } - } - } - } - }, - "SessionController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::SessionController::Client", - "rpcs": { - "CreateSession": { - "methods": [ - "create_session" - ] - }, - "GetSession": { - "methods": [ - "get_session" - ] - }, - "ListSessions": { - "methods": [ - "list_sessions" - ] - }, - "TerminateSession": { - "methods": [ - "terminate_session" - ] - }, - "DeleteSession": { - "methods": [ - "delete_session" - ] - } - } - } - } - }, - "SessionTemplateController": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client", - "rpcs": { - "CreateSessionTemplate": { - "methods": [ - "create_session_template" - ] - }, - "UpdateSessionTemplate": { - "methods": [ - "update_session_template" - ] - }, - "GetSessionTemplate": { - "methods": [ - "get_session_template" - ] - }, - "ListSessionTemplates": { - "methods": [ - "list_session_templates" - ] - }, - "DeleteSessionTemplate": { - "methods": [ - "delete_session_template" - ] - } - } - } - } - }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ - "create_workflow_template" - ] - }, - "GetWorkflowTemplate": { - "methods": [ - "get_workflow_template" - ] - }, - "InstantiateWorkflowTemplate": { - "methods": [ - "instantiate_workflow_template" - ] - }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ - "instantiate_inline_workflow_template" - ] - }, - "UpdateWorkflowTemplate": { - "methods": [ - "update_workflow_template" - ] - }, - "ListWorkflowTemplates": { - "methods": [ - "list_workflow_templates" - ] - }, - "DeleteWorkflowTemplate": { - "methods": [ - "delete_workflow_template" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec b/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec deleted file mode 100644 index 6b21d6df6491..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/google-cloud-dataproc-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/dataproc/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-dataproc-v1" - gem.version = Google::Cloud::Dataproc::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages Hadoop-based clusters and jobs on Google Cloud Platform. Note that google-cloud-dataproc-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dataproc instead. See the readme for more details." - gem.summary = "Manages Hadoop-based clusters and jobs on Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-iam-v1", ">= 0.7", "< 2.a" -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb deleted file mode 100644 index cf5b3cf47f1c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google-cloud-dataproc-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/dataproc/v1" diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb deleted file mode 100644 index 3cec95165d69..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/autoscaling_policy_service" -require "google/cloud/dataproc/v1/batch_controller" -require "google/cloud/dataproc/v1/cluster_controller" -require "google/cloud/dataproc/v1/job_controller" -require "google/cloud/dataproc/v1/node_group_controller" -require "google/cloud/dataproc/v1/session_controller" -require "google/cloud/dataproc/v1/session_template_controller" -require "google/cloud/dataproc/v1/workflow_template_service" -require "google/cloud/dataproc/v1/version" - -module Google - module Cloud - module Dataproc - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1" - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/dataproc/v1" - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/dataproc/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb deleted file mode 100644 index 8657a00c1c8d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/autoscaling_policies.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' - - -descriptor_data = "\n3google/cloud/dataproc/v1/autoscaling_policies.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xa5\x05\n\x11\x41utoscalingPolicy\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12S\n\x0f\x62\x61sic_algorithm\x18\x03 \x01(\x0b\x32\x33.google.cloud.dataproc.v1.BasicAutoscalingAlgorithmB\x03\xe0\x41\x02H\x00\x12Z\n\rworker_config\x18\x04 \x01(\x0b\x32>.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfigB\x03\xe0\x41\x02\x12\x64\n\x17secondary_worker_config\x18\x05 \x01(\x0b\x32>.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfigB\x03\xe0\x41\x01\x12L\n\x06labels\x18\x06 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.AutoscalingPolicy.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xcf\x01\xea\x41\xcb\x01\n)dataproc.googleapis.com/AutoscalingPolicy\x12Pprojects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}\x12Lprojects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}B\x0b\n\talgorithm\"\xb0\x01\n\x19\x42\x61sicAutoscalingAlgorithm\x12P\n\x0byarn_config\x18\x01 \x01(\x0b\x32\x34.google.cloud.dataproc.v1.BasicYarnAutoscalingConfigB\x03\xe0\x41\x02H\x00\x12\x37\n\x0f\x63ooldown_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\"\xf9\x01\n\x1a\x42\x61sicYarnAutoscalingConfig\x12\x45\n\x1dgraceful_decommission_timeout\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12\x1c\n\x0fscale_up_factor\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12\x1e\n\x11scale_down_factor\x18\x02 \x01(\x01\x42\x03\xe0\x41\x02\x12)\n\x1cscale_up_min_worker_fraction\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12+\n\x1escale_down_min_worker_fraction\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01\"s\n$InstanceGroupAutoscalingPolicyConfig\x12\x1a\n\rmin_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1a\n\rmax_instances\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x13\n\x06weight\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\"\xa5\x01\n\x1e\x43reateAutoscalingPolicyRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dataproc.googleapis.com/AutoscalingPolicy\x12@\n\x06policy\x18\x02 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x02\"^\n\x1bGetAutoscalingPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dataproc.googleapis.com/AutoscalingPolicy\"b\n\x1eUpdateAutoscalingPolicyRequest\x12@\n\x06policy\x18\x01 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x02\"a\n\x1e\x44\x65leteAutoscalingPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)dataproc.googleapis.com/AutoscalingPolicy\"\x94\x01\n\x1eListAutoscalingPoliciesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)dataproc.googleapis.com/AutoscalingPolicy\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x83\x01\n\x1fListAutoscalingPoliciesResponse\x12\x42\n\x08policies\x18\x01 \x03(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingPolicyB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x32\xae\x0b\n\x18\x41utoscalingPolicyService\x12\x9c\x02\n\x17\x43reateAutoscalingPolicy\x12\x38.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest\x1a+.google.cloud.dataproc.v1.AutoscalingPolicy\"\x99\x01\xda\x41\rparent,policy\x82\xd3\xe4\x93\x02\x82\x01\"7/v1/{parent=projects/*/locations/*}/autoscalingPolicies:\x06policyZ?\"5/v1/{parent=projects/*/regions/*}/autoscalingPolicies:\x06policy\x12\xa3\x02\n\x17UpdateAutoscalingPolicy\x12\x38.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest\x1a+.google.cloud.dataproc.v1.AutoscalingPolicy\"\xa0\x01\xda\x41\x06policy\x82\xd3\xe4\x93\x02\x90\x01\x1a>/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}:\x06policyZF\x1a e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates (replaces) autoscaling policy. - # - # Disabled check for update_mask, because all updates will be full - # replacements. - # - # @overload update_autoscaling_policy(request, options = nil) - # Pass arguments to `update_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_autoscaling_policy(policy: nil) - # Pass arguments to `update_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] - # Required. The updated autoscaling policy. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new - # - # # Call the update_autoscaling_policy method. - # result = client.update_autoscaling_policy request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p result - # - def update_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.policy&.name - header_params["policy.name"] = request.policy.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_autoscaling_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.call_rpc :update_autoscaling_policy, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves autoscaling policy. - # - # @overload get_autoscaling_policy(request, options = nil) - # Pass arguments to `get_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_autoscaling_policy(name: nil) - # Pass arguments to `get_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new - # - # # Call the get_autoscaling_policy method. - # result = client.get_autoscaling_policy request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p result - # - def get_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_autoscaling_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.call_rpc :get_autoscaling_policy, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists autoscaling policies in the project. - # - # @overload list_autoscaling_policies(request, options = nil) - # Pass arguments to `list_autoscaling_policies` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_autoscaling_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The "resource name" of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.list`, the resource name - # of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.autoscalingPolicies.list`, the resource name - # of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in each response. - # Must be less than or equal to 1000. Defaults to 100. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new - # - # # Call the list_autoscaling_policies method. - # result = client.list_autoscaling_policies request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p item - # end - # - def list_autoscaling_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_autoscaling_policies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_autoscaling_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_autoscaling_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.call_rpc :list_autoscaling_policies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @autoscaling_policy_service_stub, :list_autoscaling_policies, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an autoscaling policy. It is an error to delete an autoscaling - # policy that is in use by one or more clusters. - # - # @overload delete_autoscaling_policy(request, options = nil) - # Pass arguments to `delete_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_autoscaling_policy(name: nil) - # Pass arguments to `delete_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new - # - # # Call the delete_autoscaling_policy method. - # result = client.delete_autoscaling_policy request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_autoscaling_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.call_rpc :delete_autoscaling_policy, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutoscalingPolicyService API. - # - # This class represents the configuration for AutoscalingPolicyService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_autoscaling_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_autoscaling_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_autoscaling_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the AutoscalingPolicyService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_autoscaling_policy - ## - # RPC-specific configuration for `update_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_autoscaling_policy - ## - # RPC-specific configuration for `get_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_autoscaling_policy - ## - # RPC-specific configuration for `list_autoscaling_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_autoscaling_policies - ## - # RPC-specific configuration for `delete_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_autoscaling_policy - - # @private - def initialize parent_rpcs = nil - create_autoscaling_policy_config = parent_rpcs.create_autoscaling_policy if parent_rpcs.respond_to? :create_autoscaling_policy - @create_autoscaling_policy = ::Gapic::Config::Method.new create_autoscaling_policy_config - update_autoscaling_policy_config = parent_rpcs.update_autoscaling_policy if parent_rpcs.respond_to? :update_autoscaling_policy - @update_autoscaling_policy = ::Gapic::Config::Method.new update_autoscaling_policy_config - get_autoscaling_policy_config = parent_rpcs.get_autoscaling_policy if parent_rpcs.respond_to? :get_autoscaling_policy - @get_autoscaling_policy = ::Gapic::Config::Method.new get_autoscaling_policy_config - list_autoscaling_policies_config = parent_rpcs.list_autoscaling_policies if parent_rpcs.respond_to? :list_autoscaling_policies - @list_autoscaling_policies = ::Gapic::Config::Method.new list_autoscaling_policies_config - delete_autoscaling_policy_config = parent_rpcs.delete_autoscaling_policy if parent_rpcs.respond_to? :delete_autoscaling_policy - @delete_autoscaling_policy = ::Gapic::Config::Method.new delete_autoscaling_policy_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb deleted file mode 100644 index 8d418f849925..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module AutoscalingPolicyService - # Credentials for the AutoscalingPolicyService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb deleted file mode 100644 index 295a26b78f18..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/paths.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module AutoscalingPolicyService - # Path helper methods for the AutoscalingPolicyService API. - module Paths - ## - # Create a fully-qualified AutoscalingPolicy resource string. - # - # @overload autoscaling_policy_path(project:, location:, autoscaling_policy:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}` - # - # @param project [String] - # @param location [String] - # @param autoscaling_policy [String] - # - # @overload autoscaling_policy_path(project:, region:, autoscaling_policy:) - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}` - # - # @param project [String] - # @param region [String] - # @param autoscaling_policy [String] - # - # @return [::String] - def autoscaling_policy_path **args - resources = { - "autoscaling_policy:location:project" => (proc do |project:, location:, autoscaling_policy:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/autoscalingPolicies/#{autoscaling_policy}" - end), - "autoscaling_policy:project:region" => (proc do |project:, region:, autoscaling_policy:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/autoscalingPolicies/#{autoscaling_policy}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Region resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}` - # - # @param project [String] - # @param region [String] - # - # @return [::String] - def region_path project:, region: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/regions/#{region}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb deleted file mode 100644 index 50c6318edc47..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/autoscaling_policy_service/credentials" -require "google/cloud/dataproc/v1/autoscaling_policy_service/paths" -require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The API interface for managing autoscaling policies in the - # Dataproc API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - module AutoscalingPolicyService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb deleted file mode 100644 index fe3183179f15..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/client.rb +++ /dev/null @@ -1,832 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/autoscaling_policies_pb" -require "google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module AutoscalingPolicyService - module Rest - ## - # REST client for the AutoscalingPolicyService service. - # - # The API interface for managing autoscaling policies in the - # Dataproc API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :autoscaling_policy_service_stub - - ## - # Configure the AutoscalingPolicyService Client class. - # - # See {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AutoscalingPolicyService clients - # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_autoscaling_policy.timeout = 600.0 - - default_config.rpcs.update_autoscaling_policy.timeout = 600.0 - default_config.rpcs.update_autoscaling_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_autoscaling_policy.timeout = 600.0 - default_config.rpcs.get_autoscaling_policy.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_autoscaling_policies.timeout = 600.0 - default_config.rpcs.list_autoscaling_policies.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.delete_autoscaling_policy.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AutoscalingPolicyService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @autoscaling_policy_service_stub.universe_domain - end - - ## - # Create a new AutoscalingPolicyService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AutoscalingPolicyService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @autoscaling_policy_service_stub = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @autoscaling_policy_service_stub.endpoint - config.universe_domain = @autoscaling_policy_service_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates new autoscaling policy. - # - # @overload create_autoscaling_policy(request, options = nil) - # Pass arguments to `create_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_autoscaling_policy(parent: nil, policy: nil) - # Pass arguments to `create_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The "resource name" of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.create`, the resource name - # of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.autoscalingPolicies.create`, the resource name - # of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] - # Required. The autoscaling policy to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new - # - # # Call the create_autoscaling_policy method. - # result = client.create_autoscaling_policy request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p result - # - def create_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_autoscaling_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.create_autoscaling_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates (replaces) autoscaling policy. - # - # Disabled check for update_mask, because all updates will be full - # replacements. - # - # @overload update_autoscaling_policy(request, options = nil) - # Pass arguments to `update_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_autoscaling_policy(policy: nil) - # Pass arguments to `update_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param policy [::Google::Cloud::Dataproc::V1::AutoscalingPolicy, ::Hash] - # Required. The updated autoscaling policy. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new - # - # # Call the update_autoscaling_policy method. - # result = client.update_autoscaling_policy request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p result - # - def update_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_autoscaling_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.update_autoscaling_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves autoscaling policy. - # - # @overload get_autoscaling_policy(request, options = nil) - # Pass arguments to `get_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_autoscaling_policy(name: nil) - # Pass arguments to `get_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new - # - # # Call the get_autoscaling_policy method. - # result = client.get_autoscaling_policy request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p result - # - def get_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_autoscaling_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.get_autoscaling_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists autoscaling policies in the project. - # - # @overload list_autoscaling_policies(request, options = nil) - # Pass arguments to `list_autoscaling_policies` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_autoscaling_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_autoscaling_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The "resource name" of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.list`, the resource name - # of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.autoscalingPolicies.list`, the resource name - # of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in each response. - # Must be less than or equal to 1000. Defaults to 100. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new - # - # # Call the list_autoscaling_policies method. - # result = client.list_autoscaling_policies request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. - # p item - # end - # - def list_autoscaling_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_autoscaling_policies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_autoscaling_policies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_autoscaling_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.list_autoscaling_policies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @autoscaling_policy_service_stub, :list_autoscaling_policies, "policies", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes an autoscaling policy. It is an error to delete an autoscaling - # policy that is in use by one or more clusters. - # - # @overload delete_autoscaling_policy(request, options = nil) - # Pass arguments to `delete_autoscaling_policy` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_autoscaling_policy(name: nil) - # Pass arguments to `delete_autoscaling_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new - # - # # Call the delete_autoscaling_policy method. - # result = client.delete_autoscaling_policy request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_autoscaling_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_autoscaling_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_autoscaling_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_autoscaling_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @autoscaling_policy_service_stub.delete_autoscaling_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the AutoscalingPolicyService REST API. - # - # This class represents the configuration for AutoscalingPolicyService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_autoscaling_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_autoscaling_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_autoscaling_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the AutoscalingPolicyService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_autoscaling_policy - ## - # RPC-specific configuration for `update_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_autoscaling_policy - ## - # RPC-specific configuration for `get_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_autoscaling_policy - ## - # RPC-specific configuration for `list_autoscaling_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_autoscaling_policies - ## - # RPC-specific configuration for `delete_autoscaling_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_autoscaling_policy - - # @private - def initialize parent_rpcs = nil - create_autoscaling_policy_config = parent_rpcs.create_autoscaling_policy if parent_rpcs.respond_to? :create_autoscaling_policy - @create_autoscaling_policy = ::Gapic::Config::Method.new create_autoscaling_policy_config - update_autoscaling_policy_config = parent_rpcs.update_autoscaling_policy if parent_rpcs.respond_to? :update_autoscaling_policy - @update_autoscaling_policy = ::Gapic::Config::Method.new update_autoscaling_policy_config - get_autoscaling_policy_config = parent_rpcs.get_autoscaling_policy if parent_rpcs.respond_to? :get_autoscaling_policy - @get_autoscaling_policy = ::Gapic::Config::Method.new get_autoscaling_policy_config - list_autoscaling_policies_config = parent_rpcs.list_autoscaling_policies if parent_rpcs.respond_to? :list_autoscaling_policies - @list_autoscaling_policies = ::Gapic::Config::Method.new list_autoscaling_policies_config - delete_autoscaling_policy_config = parent_rpcs.delete_autoscaling_policy if parent_rpcs.respond_to? :delete_autoscaling_policy - @delete_autoscaling_policy = ::Gapic::Config::Method.new delete_autoscaling_policy_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb deleted file mode 100644 index e651fc81bc9a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/autoscaling_policy_service/rest/service_stub.rb +++ /dev/null @@ -1,403 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/autoscaling_policies_pb" - -module Google - module Cloud - module Dataproc - module V1 - module AutoscalingPolicyService - module Rest - ## - # REST service stub for the AutoscalingPolicyService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # A result object deserialized from the server's reply - def create_autoscaling_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_autoscaling_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # A result object deserialized from the server's reply - def update_autoscaling_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_autoscaling_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # A result object deserialized from the server's reply - def get_autoscaling_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_autoscaling_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_autoscaling_policies REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse] - # A result object deserialized from the server's reply - def list_autoscaling_policies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_autoscaling_policies_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_autoscaling_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_autoscaling_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_autoscaling_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/autoscalingPolicies", - body: "policy", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/autoscalingPolicies", - body: "policy", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_autoscaling_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :put, - uri_template: "/v1/{policy.name}", - body: "policy", - matches: [ - ["policy.name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :put, - uri_template: "/v1/{policy.name}", - body: "policy", - matches: [ - ["policy.name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_autoscaling_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_autoscaling_policies REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_autoscaling_policies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/autoscalingPolicies", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/autoscalingPolicies", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_autoscaling_policy REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_autoscaling_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb deleted file mode 100644 index 92abf22391f0..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/batch_controller/credentials" -require "google/cloud/dataproc/v1/batch_controller/paths" -require "google/cloud/dataproc/v1/batch_controller/operations" -require "google/cloud/dataproc/v1/batch_controller/client" -require "google/cloud/dataproc/v1/batch_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The BatchController provides methods to manage batch workloads. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/batch_controller" - # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/batch_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - module BatchController - end - end - end - end -end - -helper_path = ::File.join __dir__, "batch_controller", "helpers.rb" -require "google/cloud/dataproc/v1/batch_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb deleted file mode 100644 index c8287a1b4349..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/client.rb +++ /dev/null @@ -1,798 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/batches_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - ## - # Client for the BatchController service. - # - # The BatchController provides methods to manage batch workloads. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :batch_controller_stub - - ## - # Configure the BatchController Client class. - # - # See {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all BatchController clients - # ::Google::Cloud::Dataproc::V1::BatchController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @batch_controller_stub.universe_domain - end - - ## - # Create a new BatchController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the BatchController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/batches_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @batch_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::BatchController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @batch_controller_stub.endpoint - config.universe_domain = @batch_controller_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::BatchController::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a batch workload that executes asynchronously. - # - # @overload create_batch(request, options = nil) - # Pass arguments to `create_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_batch(parent: nil, batch: nil, batch_id: nil, request_id: nil) - # Pass arguments to `create_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this batch will be created. - # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash] - # Required. The batch to create. - # @param batch_id [::String] - # Optional. The ID to use for the batch, which will become the final - # component of the batch's resource name. - # - # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - # with the same request_id, the second request is ignored and the - # Operation that corresponds to the first Batch created and stored - # in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new - # - # # Call the create_batch method. - # result = client.create_batch request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_batch.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.call_rpc :create_batch, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the batch workload resource representation. - # - # @overload get_batch(request, options = nil) - # Pass arguments to `get_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_batch(name: nil) - # Pass arguments to `get_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Batch] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Batch] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new - # - # # Call the get_batch method. - # result = client.get_batch request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Batch. - # p result - # - def get_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_batch.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.call_rpc :get_batch, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists batch workloads. - # - # @overload list_batches(request, options = nil) - # Pass arguments to `list_batches` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListBatchesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_batches` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of batches. - # @param page_size [::Integer] - # Optional. The maximum number of batches to return in each response. - # The service may return fewer than this value. - # The default page size is 20; the maximum page size is 1000. - # @param page_token [::String] - # Optional. A page token received from a previous `ListBatches` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the batches to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each batch resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND/OR). - # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - # - # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - # filters for batches in state RUNNING that were created before 2023-01-01 - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparisons. - # @param order_by [::String] - # Optional. Field(s) on which to sort the list of batches. - # - # Currently the only supported sort orders are unspecified (empty) and - # `create_time desc` to sort by most recently created batches first. - # - # See https://google.aip.dev/132#ordering for more details. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new - # - # # Call the list_batches method. - # result = client.list_batches request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. - # p item - # end - # - def list_batches request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_batches.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_batches.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_batches.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.call_rpc :list_batches, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @batch_controller_stub, :list_batches, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the batch workload resource. If the batch is not in terminal state, - # the delete fails and the response returns `FAILED_PRECONDITION`. - # - # @overload delete_batch(request, options = nil) - # Pass arguments to `delete_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_batch(name: nil) - # Pass arguments to `delete_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new - # - # # Call the delete_batch method. - # result = client.delete_batch request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_batch.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.call_rpc :delete_batch, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the BatchController API. - # - # This class represents the configuration for BatchController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_batch to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::BatchController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_batch.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_batch.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the BatchController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :create_batch - ## - # RPC-specific configuration for `get_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :get_batch - ## - # RPC-specific configuration for `list_batches` - # @return [::Gapic::Config::Method] - # - attr_reader :list_batches - ## - # RPC-specific configuration for `delete_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_batch - - # @private - def initialize parent_rpcs = nil - create_batch_config = parent_rpcs.create_batch if parent_rpcs.respond_to? :create_batch - @create_batch = ::Gapic::Config::Method.new create_batch_config - get_batch_config = parent_rpcs.get_batch if parent_rpcs.respond_to? :get_batch - @get_batch = ::Gapic::Config::Method.new get_batch_config - list_batches_config = parent_rpcs.list_batches if parent_rpcs.respond_to? :list_batches - @list_batches = ::Gapic::Config::Method.new list_batches_config - delete_batch_config = parent_rpcs.delete_batch if parent_rpcs.respond_to? :delete_batch - @delete_batch = ::Gapic::Config::Method.new delete_batch_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb deleted file mode 100644 index ff47be3120b1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - # Credentials for the BatchController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb deleted file mode 100644 index 2226d12ab9fa..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the BatchController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb deleted file mode 100644 index 2e74bdb1ef39..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/paths.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - # Path helper methods for the BatchController API. - module Paths - ## - # Create a fully-qualified Batch resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/batches/{batch}` - # - # @param project [String] - # @param location [String] - # @param batch [String] - # - # @return [::String] - def batch_path project:, location:, batch: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/batches/#{batch}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb deleted file mode 100644 index c0553a98dab7..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/batch_controller/credentials" -require "google/cloud/dataproc/v1/batch_controller/paths" -require "google/cloud/dataproc/v1/batch_controller/rest/operations" -require "google/cloud/dataproc/v1/batch_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The BatchController provides methods to manage batch workloads. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/batch_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - module BatchController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/batch_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb deleted file mode 100644 index 59200044b3f3..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/client.rb +++ /dev/null @@ -1,752 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/batches_pb" -require "google/cloud/dataproc/v1/batch_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - module Rest - ## - # REST client for the BatchController service. - # - # The BatchController provides methods to manage batch workloads. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :batch_controller_stub - - ## - # Configure the BatchController Client class. - # - # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all BatchController clients - # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @batch_controller_stub.universe_domain - end - - ## - # Create a new BatchController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the BatchController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @batch_controller_stub = ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @batch_controller_stub.endpoint - config.universe_domain = @batch_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::BatchController::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a batch workload that executes asynchronously. - # - # @overload create_batch(request, options = nil) - # Pass arguments to `create_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_batch(parent: nil, batch: nil, batch_id: nil, request_id: nil) - # Pass arguments to `create_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this batch will be created. - # @param batch [::Google::Cloud::Dataproc::V1::Batch, ::Hash] - # Required. The batch to create. - # @param batch_id [::String] - # Optional. The ID to use for the batch, which will become the final - # component of the batch's resource name. - # - # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - # with the same request_id, the second request is ignored and the - # Operation that corresponds to the first Batch created and stored - # in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new - # - # # Call the create_batch method. - # result = client.create_batch request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_batch.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.create_batch request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the batch workload resource representation. - # - # @overload get_batch(request, options = nil) - # Pass arguments to `get_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_batch(name: nil) - # Pass arguments to `get_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Batch] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Batch] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetBatchRequest.new - # - # # Call the get_batch method. - # result = client.get_batch request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Batch. - # p result - # - def get_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_batch.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.get_batch request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists batch workloads. - # - # @overload list_batches(request, options = nil) - # Pass arguments to `list_batches` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListBatchesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_batches(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_batches` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of batches. - # @param page_size [::Integer] - # Optional. The maximum number of batches to return in each response. - # The service may return fewer than this value. - # The default page size is 20; the maximum page size is 1000. - # @param page_token [::String] - # Optional. A page token received from a previous `ListBatches` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the batches to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each batch resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND/OR). - # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - # - # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - # filters for batches in state RUNNING that were created before 2023-01-01 - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparisons. - # @param order_by [::String] - # Optional. Field(s) on which to sort the list of batches. - # - # Currently the only supported sort orders are unspecified (empty) and - # `create_time desc` to sort by most recently created batches first. - # - # See https://google.aip.dev/132#ordering for more details. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Batch>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new - # - # # Call the list_batches method. - # result = client.list_batches request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. - # p item - # end - # - def list_batches request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListBatchesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_batches.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_batches.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_batches.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.list_batches request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @batch_controller_stub, :list_batches, "batches", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the batch workload resource. If the batch is not in terminal state, - # the delete fails and the response returns `FAILED_PRECONDITION`. - # - # @overload delete_batch(request, options = nil) - # Pass arguments to `delete_batch` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteBatchRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_batch(name: nil) - # Pass arguments to `delete_batch` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new - # - # # Call the delete_batch method. - # result = client.delete_batch request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_batch request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteBatchRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_batch.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_batch.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_batch.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_controller_stub.delete_batch request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the BatchController REST API. - # - # This class represents the configuration for BatchController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_batch to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_batch.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_batch.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the BatchController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :create_batch - ## - # RPC-specific configuration for `get_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :get_batch - ## - # RPC-specific configuration for `list_batches` - # @return [::Gapic::Config::Method] - # - attr_reader :list_batches - ## - # RPC-specific configuration for `delete_batch` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_batch - - # @private - def initialize parent_rpcs = nil - create_batch_config = parent_rpcs.create_batch if parent_rpcs.respond_to? :create_batch - @create_batch = ::Gapic::Config::Method.new create_batch_config - get_batch_config = parent_rpcs.get_batch if parent_rpcs.respond_to? :get_batch - @get_batch = ::Gapic::Config::Method.new get_batch_config - list_batches_config = parent_rpcs.list_batches if parent_rpcs.respond_to? :list_batches - @list_batches = ::Gapic::Config::Method.new list_batches_config - delete_batch_config = parent_rpcs.delete_batch if parent_rpcs.respond_to? :delete_batch - @delete_batch = ::Gapic::Config::Method.new delete_batch_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb deleted file mode 100644 index b073ae3df6fb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the BatchController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb deleted file mode 100644 index e9609f7fcdcb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batch_controller/rest/service_stub.rb +++ /dev/null @@ -1,306 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/batches_pb" - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - module Rest - ## - # REST service stub for the BatchController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateBatchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_batch request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_batch_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetBatchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Batch] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Batch] - # A result object deserialized from the server's reply - def get_batch request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_batch_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Batch.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_batches REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListBatchesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListBatchesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListBatchesResponse] - # A result object deserialized from the server's reply - def list_batches request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_batches_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteBatchRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_batch request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_batch_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateBatchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_batch_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/batches", - body: "batch", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetBatchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_batch_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/batches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_batches REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListBatchesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_batches_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/batches", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_batch REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteBatchRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_batch_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/batches/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb deleted file mode 100644 index 031fce32060b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/batches.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/shared_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n&google/cloud/dataproc/v1/batches.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb0\x01\n\x12\x43reateBatchRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x64\x61taproc.googleapis.com/Batch\x12\x33\n\x05\x62\x61tch\x18\x02 \x01(\x0b\x32\x1f.google.cloud.dataproc.v1.BatchB\x03\xe0\x41\x02\x12\x15\n\x08\x62\x61tch_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"F\n\x0fGetBatchRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64\x61taproc.googleapis.com/Batch\"\xa8\x01\n\x12ListBatchesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1d\x64\x61taproc.googleapis.com/Batch\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"`\n\x13ListBatchesResponse\x12\x30\n\x07\x62\x61tches\x18\x01 \x03(\x0b\x32\x1f.google.cloud.dataproc.v1.Batch\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x12\x44\x65leteBatchRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1d\x64\x61taproc.googleapis.com/Batch\"\xc8\n\n\x05\x42\x61tch\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x44\n\rpyspark_batch\x18\x04 \x01(\x0b\x32&.google.cloud.dataproc.v1.PySparkBatchB\x03\xe0\x41\x01H\x00\x12@\n\x0bspark_batch\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.SparkBatchB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_r_batch\x18\x06 \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkRBatchB\x03\xe0\x41\x01H\x00\x12G\n\x0fspark_sql_batch\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.SparkSqlBatchB\x03\xe0\x41\x01H\x00\x12@\n\x0cruntime_info\x18\x08 \x01(\x0b\x32%.google.cloud.dataproc.v1.RuntimeInfoB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\t \x01(\x0e\x32%.google.cloud.dataproc.v1.Batch.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07\x63reator\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12@\n\x06labels\x18\r \x03(\x0b\x32+.google.cloud.dataproc.v1.Batch.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\x0f \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x16\n\toperation\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12H\n\rstate_history\x18\x11 \x03(\x0b\x32,.google.cloud.dataproc.v1.Batch.StateHistoryB\x03\xe0\x41\x03\x1a\xa0\x01\n\x0cStateHistory\x12\x39\n\x05state\x18\x01 \x01(\x0e\x32%.google.cloud.dataproc.v1.Batch.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0e\n\nCANCELLING\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06:[\xea\x41X\n\x1d\x64\x61taproc.googleapis.com/Batch\x12\x37projects/{project}/locations/{location}/batches/{batch}B\x0e\n\x0c\x62\x61tch_config\"\xb2\x01\n\x0cPySparkBatch\x12!\n\x14main_python_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10python_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\"\xb5\x01\n\nSparkBatch\x12 \n\x11main_jar_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x19\n\nmain_class\x18\x02 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x42\x08\n\x06\x64river\"q\n\x0bSparkRBatch\x12\x1c\n\x0fmain_r_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\"\xda\x01\n\rSparkSqlBatch\x12\x1b\n\x0equery_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12Y\n\x0fquery_variables\x18\x02 \x03(\x0b\x32;.google.cloud.dataproc.v1.SparkSqlBatch.QueryVariablesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13QueryVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\x9d\x06\n\x0f\x42\x61tchController\x12\xea\x01\n\x0b\x43reateBatch\x12,.google.cloud.dataproc.v1.CreateBatchRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x38\n\x05\x42\x61tch\x12/google.cloud.dataproc.v1.BatchOperationMetadata\xda\x41\x15parent,batch,batch_id\x82\xd3\xe4\x93\x02\x34\"+/v1/{parent=projects/*/locations/*}/batches:\x05\x62\x61tch\x12\x92\x01\n\x08GetBatch\x12).google.cloud.dataproc.v1.GetBatchRequest\x1a\x1f.google.cloud.dataproc.v1.Batch\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/batches/*}\x12\xa8\x01\n\x0bListBatches\x12,.google.cloud.dataproc.v1.ListBatchesRequest\x1a-.google.cloud.dataproc.v1.ListBatchesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/batches\x12\x8f\x01\n\x0b\x44\x65leteBatch\x12,.google.cloud.dataproc.v1.DeleteBatchRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/batches/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBk\n\x1c\x63om.google.cloud.dataproc.v1B\x0c\x42\x61tchesProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.dataproc.v1.RuntimeInfo", "google/cloud/dataproc/v1/shared.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - CreateBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateBatchRequest").msgclass - GetBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetBatchRequest").msgclass - ListBatchesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListBatchesRequest").msgclass - ListBatchesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListBatchesResponse").msgclass - DeleteBatchRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteBatchRequest").msgclass - Batch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch").msgclass - Batch::StateHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch.StateHistory").msgclass - Batch::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Batch.State").enummodule - PySparkBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PySparkBatch").msgclass - SparkBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkBatch").msgclass - SparkRBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkRBatch").msgclass - SparkSqlBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkSqlBatch").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb deleted file mode 100644 index 5da1b888618f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/batches_services_pb.rb +++ /dev/null @@ -1,52 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/batches.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/batches_pb' - -module Google - module Cloud - module Dataproc - module V1 - module BatchController - # The BatchController provides methods to manage batch workloads. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.BatchController' - - # Creates a batch workload that executes asynchronously. - rpc :CreateBatch, ::Google::Cloud::Dataproc::V1::CreateBatchRequest, ::Google::Longrunning::Operation - # Gets the batch workload resource representation. - rpc :GetBatch, ::Google::Cloud::Dataproc::V1::GetBatchRequest, ::Google::Cloud::Dataproc::V1::Batch - # Lists batch workloads. - rpc :ListBatches, ::Google::Cloud::Dataproc::V1::ListBatchesRequest, ::Google::Cloud::Dataproc::V1::ListBatchesResponse - # Deletes the batch workload resource. If the batch is not in terminal state, - # the delete fails and the response returns `FAILED_PRECONDITION`. - rpc :DeleteBatch, ::Google::Cloud::Dataproc::V1::DeleteBatchRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb deleted file mode 100644 index 7a01a2d2075d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/bindings_override.rb +++ /dev/null @@ -1,257 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module Dataproc - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/dataproc/v1/rest" - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Configuration.new parent_config - default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/jobs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private - # Configuration class for the google.cloud.dataproc.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.dataproc.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb deleted file mode 100644 index c489bcb25bdb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/cluster_controller/credentials" -require "google/cloud/dataproc/v1/cluster_controller/paths" -require "google/cloud/dataproc/v1/cluster_controller/operations" -require "google/cloud/dataproc/v1/cluster_controller/client" -require "google/cloud/dataproc/v1/cluster_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The ClusterControllerService provides methods to manage clusters - # of Compute Engine instances. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/cluster_controller" - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/cluster_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - module ClusterController - end - end - end - end -end - -helper_path = ::File.join __dir__, "cluster_controller", "helpers.rb" -require "google/cloud/dataproc/v1/cluster_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb deleted file mode 100644 index 89899559790b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +++ /dev/null @@ -1,1464 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/clusters_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - ## - # Client for the ClusterController service. - # - # The ClusterControllerService provides methods to manage clusters - # of Compute Engine instances. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cluster_controller_stub - - ## - # Configure the ClusterController Client class. - # - # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ClusterController clients - # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_cluster.timeout = 300.0 - default_config.rpcs.create_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_cluster.timeout = 300.0 - default_config.rpcs.update_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_cluster.timeout = 300.0 - default_config.rpcs.delete_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 300.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] - } - - default_config.rpcs.list_clusters.timeout = 300.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] - } - - default_config.rpcs.diagnose_cluster.timeout = 300.0 - default_config.rpcs.diagnose_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ClusterController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cluster_controller_stub.universe_domain - end - - ## - # Create a new ClusterController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ClusterController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/clusters_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cluster_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::ClusterController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cluster_controller_stub.endpoint - config.universe_domain = @cluster_controller_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::ClusterController::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil, action_on_failed_primary_workers: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] - # Required. The cluster to create. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param action_on_failed_primary_workers [::Google::Cloud::Dataproc::V1::FailureAction] - # Optional. Failure action when primary worker creation fails. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :create_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # The cluster must be in a - # {::Google::Cloud::Dataproc::V1::ClusterStatus::State `RUNNING`} state or an error - # is returned. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_cluster(project_id: nil, region: nil, cluster_name: nil, cluster: nil, graceful_decommission_timeout: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] - # Required. The changes to the cluster. - # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] - # Optional. Timeout for graceful YARN decommissioning. Graceful - # decommissioning allows removing nodes from the cluster without - # interrupting jobs in progress. Timeout specifies how long to wait for jobs - # in progress to finish before forcefully removing nodes (and potentially - # interrupting jobs). Default timeout is 0 (for forceful decommission), and - # the maximum allowed timeout is 1 day. (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the path, relative to `Cluster`, of - # the field to update. For example, to change the number of workers - # in a cluster to 5, the `update_mask` parameter would be - # specified as `config.worker_config.num_instances`, - # and the `PATCH` request body would specify the new value, as follows: - # - # { - # "config":{ - # "workerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Similarly, to change the number of preemptible workers in a cluster to 5, - # the `update_mask` parameter would be - # `config.secondary_worker_config.num_instances`, and the `PATCH` request - # body would be set as follows: - # - # { - # "config":{ - # "secondaryWorkerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Note: Currently, only the following fields can be updated: - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - # change autoscaling policies
- # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :update_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops a cluster in a project. - # - # @overload stop_cluster(request, options = nil) - # Pass arguments to `stop_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::StopClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `stop_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new - # - # # Call the stop_cluster method. - # result = client.stop_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def stop_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StopClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.stop_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :stop_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a cluster in a project. - # - # @overload start_cluster(request, options = nil) - # Pass arguments to `start_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::StartClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `start_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new - # - # # Call the start_cluster method. - # result = client.start_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def start_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StartClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.start_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.start_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :start_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC should fail - # (with error NOT_FOUND) if cluster with specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :delete_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a cluster in a project. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_cluster(project_id: nil, region: nil, cluster_name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :get_cluster, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all regions/\\{region}/clusters in a project alphabetically. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_clusters(project_id: nil, region: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param filter [::String] - # Optional. A filter constraining the clusters to list. Filters are - # case-sensitive and have the following syntax: - # - # field = value [AND [field = value]] ... - # - # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - # and `[KEY]` is a label key. **value** can be `*` to match all values. - # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` - # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` - # contains the `DELETING` and `ERROR` states. - # `clusterName` is the name of the cluster provided at creation time. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND clusterName = mycluster - # AND labels.env = staging AND labels.starred = * - # @param page_size [::Integer] - # Optional. The standard List page size. - # @param page_token [::String] - # Optional. The standard List page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @cluster_controller_stub, :list_clusters, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets cluster diagnostic information. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # After the operation completes, - # {::Google::Longrunning::Operation#response Operation.response} - # contains - # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - # - # @overload diagnose_cluster(request, options = nil) - # Pass arguments to `diagnose_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) - # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param tarball_gcs_dir [::String] - # Optional. The output Cloud Storage directory for the diagnostic - # tarball. If not specified, a task-specific directory in the cluster's - # staging bucket will be used. - # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] - # Optional. (Optional) The access type to the diagnostic tarball. If not - # specified, falls back to default access of the bucket - # @param diagnosis_interval [::Google::Type::Interval, ::Hash] - # Optional. Time interval in which diagnosis should be carried out on the - # cluster. - # @param jobs [::Array<::String>] - # Optional. Specifies a list of jobs on which diagnosis is to be performed. - # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} - # @param yarn_application_ids [::Array<::String>] - # Optional. Specifies a list of yarn applications on which diagnosis is to be - # performed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new - # - # # Call the diagnose_cluster method. - # result = client.diagnose_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def diagnose_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.diagnose_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.cluster_name - header_params["cluster_name"] = request.cluster_name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.diagnose_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.call_rpc :diagnose_cluster, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ClusterController API. - # - # This class represents the configuration for ClusterController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the ClusterController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `stop_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_cluster - ## - # RPC-specific configuration for `start_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :start_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `diagnose_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :diagnose_cluster - - # @private - def initialize parent_rpcs = nil - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - stop_cluster_config = parent_rpcs.stop_cluster if parent_rpcs.respond_to? :stop_cluster - @stop_cluster = ::Gapic::Config::Method.new stop_cluster_config - start_cluster_config = parent_rpcs.start_cluster if parent_rpcs.respond_to? :start_cluster - @start_cluster = ::Gapic::Config::Method.new start_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - diagnose_cluster_config = parent_rpcs.diagnose_cluster if parent_rpcs.respond_to? :diagnose_cluster - @diagnose_cluster = ::Gapic::Config::Method.new diagnose_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb deleted file mode 100644 index cb8ab333e2ed..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - # Credentials for the ClusterController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb deleted file mode 100644 index bdefb9cfc20a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ClusterController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the ClusterController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb deleted file mode 100644 index e8061ae72751..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - # Path helper methods for the ClusterController API. - module Paths - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified NodeGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` - # - # @param project [String] - # @param region [String] - # @param cluster [String] - # @param node_group [String] - # - # @return [::String] - def node_group_path project:, region:, cluster:, node_group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/services/#{service}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb deleted file mode 100644 index 652c94fad760..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/cluster_controller/credentials" -require "google/cloud/dataproc/v1/cluster_controller/paths" -require "google/cloud/dataproc/v1/cluster_controller/rest/operations" -require "google/cloud/dataproc/v1/cluster_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The ClusterControllerService provides methods to manage clusters - # of Compute Engine instances. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/cluster_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - module ClusterController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/cluster_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb deleted file mode 100644 index 24bda580883b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/client.rb +++ /dev/null @@ -1,1348 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/clusters_pb" -require "google/cloud/dataproc/v1/cluster_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - module Rest - ## - # REST client for the ClusterController service. - # - # The ClusterControllerService provides methods to manage clusters - # of Compute Engine instances. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :cluster_controller_stub - - ## - # Configure the ClusterController Client class. - # - # See {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ClusterController clients - # ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_cluster.timeout = 300.0 - default_config.rpcs.create_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_cluster.timeout = 300.0 - default_config.rpcs.update_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_cluster.timeout = 300.0 - default_config.rpcs.delete_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 300.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] - } - - default_config.rpcs.list_clusters.timeout = 300.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14] - } - - default_config.rpcs.diagnose_cluster.timeout = 300.0 - default_config.rpcs.diagnose_cluster.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ClusterController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @cluster_controller_stub.universe_domain - end - - ## - # Create a new ClusterController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ClusterController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @cluster_controller_stub = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @cluster_controller_stub.endpoint - config.universe_domain = @cluster_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::ClusterController::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_cluster(project_id: nil, region: nil, cluster: nil, request_id: nil, action_on_failed_primary_workers: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] - # Required. The cluster to create. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param action_on_failed_primary_workers [::Google::Cloud::Dataproc::V1::FailureAction] - # Optional. Failure action when primary worker creation fails. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.create_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # The cluster must be in a - # {::Google::Cloud::Dataproc::V1::ClusterStatus::State `RUNNING`} state or an error - # is returned. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_cluster(project_id: nil, region: nil, cluster_name: nil, cluster: nil, graceful_decommission_timeout: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash] - # Required. The changes to the cluster. - # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] - # Optional. Timeout for graceful YARN decommissioning. Graceful - # decommissioning allows removing nodes from the cluster without - # interrupting jobs in progress. Timeout specifies how long to wait for jobs - # in progress to finish before forcefully removing nodes (and potentially - # interrupting jobs). Default timeout is 0 (for forceful decommission), and - # the maximum allowed timeout is 1 day. (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the path, relative to `Cluster`, of - # the field to update. For example, to change the number of workers - # in a cluster to 5, the `update_mask` parameter would be - # specified as `config.worker_config.num_instances`, - # and the `PATCH` request body would specify the new value, as follows: - # - # { - # "config":{ - # "workerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Similarly, to change the number of preemptible workers in a cluster to 5, - # the `update_mask` parameter would be - # `config.secondary_worker_config.num_instances`, and the `PATCH` request - # body would be set as follows: - # - # { - # "config":{ - # "secondaryWorkerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Note: Currently, only the following fields can be updated: - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - # change autoscaling policies
- # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.update_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Stops a cluster in a project. - # - # @overload stop_cluster(request, options = nil) - # Pass arguments to `stop_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::StopClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `stop_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::StopClusterRequest.new - # - # # Call the stop_cluster method. - # result = client.stop_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def stop_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StopClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.stop_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.stop_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a cluster in a project. - # - # @overload start_cluster(request, options = nil) - # Pass arguments to `start_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::StartClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `start_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::StartClusterRequest.new - # - # # Call the start_cluster method. - # result = client.start_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def start_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StartClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.start_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.start_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.start_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a cluster in a project. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param cluster_uuid [::String] - # Optional. Specifying the `cluster_uuid` means the RPC should fail - # (with error NOT_FOUND) if cluster with specified UUID does not exist. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.delete_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a cluster in a project. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_cluster(project_id: nil, region: nil, cluster_name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.get_cluster request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists all regions/\\{region}/clusters in a project alphabetically. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_clusters(project_id: nil, region: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param filter [::String] - # Optional. A filter constraining the clusters to list. Filters are - # case-sensitive and have the following syntax: - # - # field = value [AND [field = value]] ... - # - # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - # and `[KEY]` is a label key. **value** can be `*` to match all values. - # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` - # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` - # contains the `DELETING` and `ERROR` states. - # `clusterName` is the name of the cluster provided at creation time. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND clusterName = mycluster - # AND labels.env = staging AND labels.starred = * - # @param page_size [::Integer] - # Optional. The standard List page size. - # @param page_token [::String] - # Optional. The standard List page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListClustersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_clusters.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @cluster_controller_stub, :list_clusters, "clusters", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets cluster diagnostic information. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # After the operation completes, - # {::Google::Longrunning::Operation#response Operation.response} - # contains - # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - # - # @overload diagnose_cluster(request, options = nil) - # Pass arguments to `diagnose_cluster` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil) - # Pass arguments to `diagnose_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param cluster_name [::String] - # Required. The cluster name. - # @param tarball_gcs_dir [::String] - # Optional. The output Cloud Storage directory for the diagnostic - # tarball. If not specified, a task-specific directory in the cluster's - # staging bucket will be used. - # @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] - # Optional. (Optional) The access type to the diagnostic tarball. If not - # specified, falls back to default access of the bucket - # @param diagnosis_interval [::Google::Type::Interval, ::Hash] - # Optional. Time interval in which diagnosis should be carried out on the - # cluster. - # @param jobs [::Array<::String>] - # Optional. Specifies a list of jobs on which diagnosis is to be performed. - # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} - # @param yarn_application_ids [::Array<::String>] - # Optional. Specifies a list of yarn applications on which diagnosis is to be - # performed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new - # - # # Call the diagnose_cluster method. - # result = client.diagnose_cluster request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def diagnose_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.diagnose_cluster.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.diagnose_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @cluster_controller_stub.diagnose_cluster request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the ClusterController REST API. - # - # This class represents the configuration for ClusterController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_cluster.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the ClusterController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `stop_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_cluster - ## - # RPC-specific configuration for `start_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :start_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `diagnose_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :diagnose_cluster - - # @private - def initialize parent_rpcs = nil - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - stop_cluster_config = parent_rpcs.stop_cluster if parent_rpcs.respond_to? :stop_cluster - @stop_cluster = ::Gapic::Config::Method.new stop_cluster_config - start_cluster_config = parent_rpcs.start_cluster if parent_rpcs.respond_to? :start_cluster - @start_cluster = ::Gapic::Config::Method.new start_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - diagnose_cluster_config = parent_rpcs.diagnose_cluster if parent_rpcs.respond_to? :diagnose_cluster - @diagnose_cluster = ::Gapic::Config::Method.new diagnose_cluster_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb deleted file mode 100644 index 702d184106b4..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ClusterController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the ClusterController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb deleted file mode 100644 index 6dc7da911d79..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/cluster_controller/rest/service_stub.rb +++ /dev/null @@ -1,560 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/clusters_pb" - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - module Rest - ## - # REST service stub for the ClusterController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the stop_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::StopClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def stop_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the start_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::StartClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def start_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Cluster.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListClustersResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the diagnose_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def diagnose_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_diagnose_cluster_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters", - body: "cluster", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - body: "cluster", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::StopClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::StartClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListClustersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the diagnose_cluster REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_diagnose_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["cluster_name", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb deleted file mode 100644 index 723a6669cfa1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_pb.rb +++ /dev/null @@ -1,112 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/clusters.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/operations_pb' -require 'google/cloud/dataproc/v1/shared_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/protobuf/wrappers_pb' -require 'google/type/interval_pb' - - -descriptor_data = "\n\'google/cloud/dataproc/v1/clusters.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/dataproc/v1/operations.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1agoogle/type/interval.proto\"\xa2\x04\n\x07\x43luster\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x01\x12S\n\x16virtual_cluster_config\x18\n \x01(\x0b\x32..google.cloud.dataproc.v1.VirtualClusterConfigB\x03\xe0\x41\x01\x12\x42\n\x06labels\x18\x08 \x03(\x0b\x32-.google.cloud.dataproc.v1.Cluster.LabelsEntryB\x03\xe0\x41\x01\x12<\n\x06status\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x44\n\x0estatus_history\x18\x07 \x03(\x0b\x32\'.google.cloud.dataproc.v1.ClusterStatusB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12>\n\x07metrics\x18\t \x01(\x0b\x32(.google.cloud.dataproc.v1.ClusterMetricsB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\t\n\rClusterConfig\x12\x1a\n\rconfig_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0btemp_bucket\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12K\n\x12gce_cluster_config\x18\x08 \x01(\x0b\x32*.google.cloud.dataproc.v1.GceClusterConfigB\x03\xe0\x41\x01\x12I\n\rmaster_config\x18\t \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12I\n\rworker_config\x18\n \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12S\n\x17secondary_worker_config\x18\x0c \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsoftware_config\x18\r \x01(\x0b\x32(.google.cloud.dataproc.v1.SoftwareConfigB\x03\xe0\x41\x01\x12W\n\x16initialization_actions\x18\x0b \x03(\x0b\x32\x32.google.cloud.dataproc.v1.NodeInitializationActionB\x03\xe0\x41\x01\x12J\n\x11\x65ncryption_config\x18\x0f \x01(\x0b\x32*.google.cloud.dataproc.v1.EncryptionConfigB\x03\xe0\x41\x01\x12L\n\x12\x61utoscaling_config\x18\x12 \x01(\x0b\x32+.google.cloud.dataproc.v1.AutoscalingConfigB\x03\xe0\x41\x01\x12\x46\n\x0fsecurity_config\x18\x10 \x01(\x0b\x32(.google.cloud.dataproc.v1.SecurityConfigB\x03\xe0\x41\x01\x12H\n\x10lifecycle_config\x18\x11 \x01(\x0b\x32).google.cloud.dataproc.v1.LifecycleConfigB\x03\xe0\x41\x01\x12\x46\n\x0f\x65ndpoint_config\x18\x13 \x01(\x0b\x32(.google.cloud.dataproc.v1.EndpointConfigB\x03\xe0\x41\x01\x12H\n\x10metastore_config\x18\x14 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12S\n\x16\x64\x61taproc_metric_config\x18\x17 \x01(\x0b\x32..google.cloud.dataproc.v1.DataprocMetricConfigB\x03\xe0\x41\x01\x12P\n\x15\x61uxiliary_node_groups\x18\x19 \x03(\x0b\x32,.google.cloud.dataproc.v1.AuxiliaryNodeGroupB\x03\xe0\x41\x01\"\x84\x02\n\x14VirtualClusterConfig\x12\x1b\n\x0estaging_bucket\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12[\n\x19kubernetes_cluster_config\x18\x06 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.KubernetesClusterConfigB\x03\xe0\x41\x02H\x00\x12Y\n\x19\x61uxiliary_services_config\x18\x07 \x01(\x0b\x32\x31.google.cloud.dataproc.v1.AuxiliaryServicesConfigB\x03\xe0\x41\x01\x42\x17\n\x15infrastructure_config\"\xc1\x01\n\x17\x41uxiliaryServicesConfig\x12H\n\x10metastore_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.MetastoreConfigB\x03\xe0\x41\x01\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xba\x01\n\x0e\x45ndpointConfig\x12P\n\nhttp_ports\x18\x01 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.EndpointConfig.HttpPortsEntryB\x03\xe0\x41\x03\x12$\n\x17\x65nable_http_port_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x30\n\x0eHttpPortsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\",\n\x11\x41utoscalingConfig\x12\x17\n\npolicy_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\"4\n\x10\x45ncryptionConfig\x12 \n\x13gce_pd_kms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xba\x07\n\x10GceClusterConfig\x12\x15\n\x08zone_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bnetwork_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0esubnetwork_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x10internal_ip_only\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12k\n\x1aprivate_ipv6_google_access\x18\x0c \x01(\x0e\x32\x42.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccessB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x0c\n\x04tags\x18\x04 \x03(\t\x12O\n\x08metadata\x18\x05 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.GceClusterConfig.MetadataEntryB\x03\xe0\x41\x01\x12P\n\x14reservation_affinity\x18\x0b \x01(\x0b\x32-.google.cloud.dataproc.v1.ReservationAffinityB\x03\xe0\x41\x01\x12M\n\x13node_group_affinity\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.NodeGroupAffinityB\x03\xe0\x41\x01\x12W\n\x18shielded_instance_config\x18\x0e \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12_\n\x1c\x63onfidential_instance_config\x18\x0f \x01(\x0b\x32\x34.google.cloud.dataproc.v1.ConfidentialInstanceConfigB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x01\n\x17PrivateIpv6GoogleAccess\x12*\n&PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED\x10\x00\x12\x1b\n\x17INHERIT_FROM_SUBNETWORK\x10\x01\x12\x0c\n\x08OUTBOUND\x10\x02\x12\x11\n\rBIDIRECTIONAL\x10\x03\x42\x13\n\x11_internal_ip_only\"0\n\x11NodeGroupAffinity\x12\x1b\n\x0enode_group_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xd3\x01\n\x16ShieldedInstanceConfig\x12$\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12-\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x42\x15\n\x13_enable_secure_bootB\x0e\n\x0c_enable_vtpmB\x1e\n\x1c_enable_integrity_monitoring\"F\n\x1a\x43onfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"\xeb\x06\n\x13InstanceGroupConfig\x12\x1a\n\rnum_instances\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0einstance_names\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12M\n\x13instance_references\x18\x0b \x03(\x0b\x32+.google.cloud.dataproc.v1.InstanceReferenceB\x03\xe0\x41\x03\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10machine_type_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12>\n\x0b\x64isk_config\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.DiskConfigB\x03\xe0\x41\x01\x12\x1b\n\x0eis_preemptible\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12Y\n\x0epreemptibility\x18\n \x01(\x0e\x32<.google.cloud.dataproc.v1.InstanceGroupConfig.PreemptibilityB\x03\xe0\x41\x01\x12O\n\x14managed_group_config\x18\x07 \x01(\x0b\x32,.google.cloud.dataproc.v1.ManagedGroupConfigB\x03\xe0\x41\x03\x12\x46\n\x0c\x61\x63\x63\x65lerators\x18\x08 \x03(\x0b\x32+.google.cloud.dataproc.v1.AcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11min_num_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x01\x12]\n\x1binstance_flexibility_policy\x18\r \x01(\x0b\x32\x33.google.cloud.dataproc.v1.InstanceFlexibilityPolicyB\x03\xe0\x41\x01\x12\x44\n\x0estartup_config\x18\x0e \x01(\x0b\x32\'.google.cloud.dataproc.v1.StartupConfigB\x03\xe0\x41\x01\"`\n\x0ePreemptibility\x12\x1e\n\x1aPREEMPTIBILITY_UNSPECIFIED\x10\x00\x12\x13\n\x0fNON_PREEMPTIBLE\x10\x01\x12\x0f\n\x0bPREEMPTIBLE\x10\x02\x12\x08\n\x04SPOT\x10\x03\"d\n\rStartupConfig\x12\x30\n\x1erequired_registration_fraction\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42!\n\x1f_required_registration_fraction\"m\n\x11InstanceReference\x12\x15\n\rinstance_name\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x12\n\npublic_key\x18\x03 \x01(\t\x12\x18\n\x10public_ecies_key\x18\x04 \x01(\t\"\x8c\x01\n\x12ManagedGroupConfig\x12#\n\x16instance_template_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12(\n\x1binstance_group_manager_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1ainstance_group_manager_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xb7\x03\n\x19InstanceFlexibilityPolicy\x12k\n\x17instance_selection_list\x18\x02 \x03(\x0b\x32\x45.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionB\x03\xe0\x41\x01\x12t\n\x1ainstance_selection_results\x18\x03 \x03(\x0b\x32K.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResultB\x03\xe0\x41\x03\x1a\x42\n\x11InstanceSelection\x12\x1a\n\rmachine_types\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04rank\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1as\n\x17InstanceSelectionResult\x12\x1e\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1a\n\x08vm_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x42\x0f\n\r_machine_typeB\x0b\n\t_vm_count\"L\n\x11\x41\x63\x63\x65leratorConfig\x12\x1c\n\x14\x61\x63\x63\x65lerator_type_uri\x18\x01 \x01(\t\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x02 \x01(\x05\"\x88\x01\n\nDiskConfig\x12\x1b\n\x0e\x62oot_disk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1b\n\x0enum_local_ssds\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12 \n\x13local_ssd_interface\x18\x04 \x01(\tB\x03\xe0\x41\x01\"n\n\x12\x41uxiliaryNodeGroup\x12<\n\nnode_group\x18\x01 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbd\x03\n\tNodeGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12<\n\x05roles\x18\x02 \x03(\x0e\x32(.google.cloud.dataproc.v1.NodeGroup.RoleB\x03\xe0\x41\x02\x12M\n\x11node_group_config\x18\x03 \x01(\x0b\x32-.google.cloud.dataproc.v1.InstanceGroupConfigB\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.dataproc.v1.NodeGroup.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"(\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44RIVER\x10\x01:v\xea\x41s\n!dataproc.googleapis.com/NodeGroup\x12Nprojects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}\"s\n\x18NodeInitializationAction\x12\x1c\n\x0f\x65xecutable_file\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x11\x65xecution_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xd6\x03\n\rClusterStatus\x12\x41\n\x05state\x18\x01 \x01(\x0e\x32-.google.cloud.dataproc.v1.ClusterStatus.StateB\x03\xe0\x41\x03\x12\x16\n\x06\x64\x65tail\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x08substate\x18\x04 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.ClusterStatus.SubstateB\x03\xe0\x41\x03\"\xa7\x01\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x17\n\x13\x45RROR_DUE_TO_UPDATE\x10\t\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0c\n\x08UPDATING\x10\x05\x12\x0c\n\x08STOPPING\x10\x06\x12\x0b\n\x07STOPPED\x10\x07\x12\x0c\n\x08STARTING\x10\x08\x12\r\n\tREPAIRING\x10\n\"<\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tUNHEALTHY\x10\x01\x12\x10\n\x0cSTALE_STATUS\x10\x02\"\xa0\x01\n\x0eSecurityConfig\x12\x46\n\x0fkerberos_config\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.KerberosConfigB\x03\xe0\x41\x01\x12\x46\n\x0fidentity_config\x18\x02 \x01(\x0b\x32(.google.cloud.dataproc.v1.IdentityConfigB\x03\xe0\x41\x01\"\x90\x04\n\x0eKerberosConfig\x12\x1c\n\x0f\x65nable_kerberos\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1broot_principal_password_uri\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bkms_key_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0ckeystore_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0etruststore_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15keystore_password_uri\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1d\n\x10key_password_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17truststore_password_uri\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x63ross_realm_trust_realm\x18\t \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15\x63ross_realm_trust_kdc\x18\n \x01(\tB\x03\xe0\x41\x01\x12+\n\x1e\x63ross_realm_trust_admin_server\x18\x0b \x01(\tB\x03\xe0\x41\x01\x12\x32\n%cross_realm_trust_shared_password_uri\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0ekdc_db_key_uri\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12tgt_lifetime_hours\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\x05realm\x18\x0f \x01(\tB\x03\xe0\x41\x01\"\xc6\x01\n\x0eIdentityConfig\x12r\n\x1cuser_service_account_mapping\x18\x01 \x03(\x0b\x32G.google.cloud.dataproc.v1.IdentityConfig.UserServiceAccountMappingEntryB\x03\xe0\x41\x02\x1a@\n\x1eUserServiceAccountMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf9\x01\n\x0eSoftwareConfig\x12\x1a\n\rimage_version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\nproperties\x18\x02 \x03(\x0b\x32\x38.google.cloud.dataproc.v1.SoftwareConfig.PropertiesEntryB\x03\xe0\x41\x01\x12\x45\n\x13optional_components\x18\x03 \x03(\x0e\x32#.google.cloud.dataproc.v1.ComponentB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x83\x02\n\x0fLifecycleConfig\x12\x37\n\x0fidle_delete_ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12;\n\x10\x61uto_delete_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12\x39\n\x0f\x61uto_delete_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01H\x00\x12\x38\n\x0fidle_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x05\n\x03ttl\"_\n\x0fMetastoreConfig\x12L\n\x1a\x64\x61taproc_metastore_service\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n metastore.googleapis.com/Service\"\x9a\x02\n\x0e\x43lusterMetrics\x12O\n\x0chdfs_metrics\x18\x01 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.HdfsMetricsEntry\x12O\n\x0cyarn_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.ClusterMetrics.YarnMetricsEntry\x1a\x32\n\x10HdfsMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10YarnMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"\x92\x03\n\x14\x44\x61taprocMetricConfig\x12K\n\x07metrics\x18\x01 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.DataprocMetricConfig.MetricB\x03\xe0\x41\x02\x1a\x80\x01\n\x06Metric\x12W\n\rmetric_source\x18\x01 \x01(\x0e\x32;.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSourceB\x03\xe0\x41\x02\x12\x1d\n\x10metric_overrides\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xa9\x01\n\x0cMetricSource\x12\x1d\n\x19METRIC_SOURCE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MONITORING_AGENT_DEFAULTS\x10\x01\x12\x08\n\x04HDFS\x10\x02\x12\t\n\x05SPARK\x10\x03\x12\x08\n\x04YARN\x10\x04\x12\x18\n\x14SPARK_HISTORY_SERVER\x10\x05\x12\x0f\n\x0bHIVESERVER2\x10\x06\x12\x11\n\rHIVEMETASTORE\x10\x07\"\xee\x01\n\x14\x43reateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12V\n action_on_failed_primary_workers\x18\x05 \x01(\x0e\x32\'.google.cloud.dataproc.v1.FailureActionB\x03\xe0\x41\x01\"\xae\x02\n\x14UpdateClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x02\x12\x45\n\x1dgraceful_decommission_timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\"\x91\x01\n\x12StopClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x92\x01\n\x13StartClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x14\x44\x65leteClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\\\n\x11GetClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\x89\x01\n\x13ListClustersRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"n\n\x14ListClustersResponse\x12\x38\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.ClusterB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"\xb3\x03\n\x16\x44iagnoseClusterRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0ftarball_gcs_dir\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0etarball_access\x18\x05 \x01(\x0e\x32>.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccessB\x03\xe0\x41\x01\x12\x36\n\x12\x64iagnosis_interval\x18\x06 \x01(\x0b\x32\x15.google.type.IntervalB\x03\xe0\x41\x01\x12\x11\n\x04jobs\x18\n \x03(\tB\x03\xe0\x41\x01\x12!\n\x14yarn_application_ids\x18\x0b \x03(\tB\x03\xe0\x41\x01\"g\n\rTarballAccess\x12\x1e\n\x1aTARBALL_ACCESS_UNSPECIFIED\x10\x00\x12\x18\n\x14GOOGLE_CLOUD_SUPPORT\x10\x01\x12\x1c\n\x18GOOGLE_DATAPROC_DIAGNOSE\x10\x02\"1\n\x16\x44iagnoseClusterResults\x12\x17\n\noutput_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xf8\x01\n\x13ReservationAffinity\x12Y\n\x18\x63onsume_reservation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dataproc.v1.ReservationAffinity.TypeB\x03\xe0\x41\x01\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06values\x18\x03 \x03(\tB\x03\xe0\x41\x01\"_\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eNO_RESERVATION\x10\x01\x12\x13\n\x0f\x41NY_RESERVATION\x10\x02\x12\x18\n\x14SPECIFIC_RESERVATION\x10\x03\x32\xe4\x10\n\x11\x43lusterController\x12\x80\x02\n\rCreateCluster\x12..google.cloud.dataproc.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x19project_id,region,cluster\x82\xd3\xe4\x93\x02>\"3/v1/projects/{project_id}/regions/{region}/clusters:\x07\x63luster\x12\xa8\x02\n\rUpdateCluster\x12..google.cloud.dataproc.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x32project_id,region,cluster_name,cluster,update_mask\x82\xd3\xe4\x93\x02M2B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:\x07\x63luster\x12\xee\x01\n\x0bStopCluster\x12,.google.cloud.dataproc.v1.StopClusterRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02L\"G/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop:\x01*\x12\xf1\x01\n\x0cStartCluster\x12-.google.cloud.dataproc.v1.StartClusterRequest\x1a\x1d.google.longrunning.Operation\"\x92\x01\xca\x41<\n\x07\x43luster\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\x82\xd3\xe4\x93\x02M\"H/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start:\x01*\x12\x99\x02\n\rDeleteCluster\x12..google.cloud.dataproc.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41J\n\x15google.protobuf.Empty\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44*B/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xc9\x01\n\nGetCluster\x12+.google.cloud.dataproc.v1.GetClusterRequest\x1a!.google.cloud.dataproc.v1.Cluster\"k\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}\x12\xd9\x01\n\x0cListClusters\x12-.google.cloud.dataproc.v1.ListClustersRequest\x1a..google.cloud.dataproc.v1.ListClustersResponse\"j\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/projects/{project_id}/regions/{region}/clusters\x12\xaa\x02\n\x0f\x44iagnoseCluster\x12\x30.google.cloud.dataproc.v1.DiagnoseClusterRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41K\n\x16\x44iagnoseClusterResults\x12\x31google.cloud.dataproc.v1.ClusterOperationMetadata\xda\x41\x1eproject_id,region,cluster_name\x82\xd3\xe4\x93\x02P\"K/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose:\x01*\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rClustersProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dataproc.v1.KubernetesClusterConfig", "google/cloud/dataproc/v1/shared.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ["google.type.Interval", "google/type/interval.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Cluster").msgclass - ClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterConfig").msgclass - VirtualClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.VirtualClusterConfig").msgclass - AuxiliaryServicesConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AuxiliaryServicesConfig").msgclass - EndpointConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EndpointConfig").msgclass - AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutoscalingConfig").msgclass - EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EncryptionConfig").msgclass - GceClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GceClusterConfig").msgclass - GceClusterConfig::PrivateIpv6GoogleAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess").enummodule - NodeGroupAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupAffinity").msgclass - ShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ShieldedInstanceConfig").msgclass - ConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ConfidentialInstanceConfig").msgclass - InstanceGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceGroupConfig").msgclass - InstanceGroupConfig::Preemptibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility").enummodule - StartupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StartupConfig").msgclass - InstanceReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceReference").msgclass - ManagedGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ManagedGroupConfig").msgclass - InstanceFlexibilityPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy").msgclass - InstanceFlexibilityPolicy::InstanceSelection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection").msgclass - InstanceFlexibilityPolicy::InstanceSelectionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult").msgclass - AcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AcceleratorConfig").msgclass - DiskConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiskConfig").msgclass - AuxiliaryNodeGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AuxiliaryNodeGroup").msgclass - NodeGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroup").msgclass - NodeGroup::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroup.Role").enummodule - NodeInitializationAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeInitializationAction").msgclass - ClusterStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus").msgclass - ClusterStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus.State").enummodule - ClusterStatus::Substate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterStatus.Substate").enummodule - SecurityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SecurityConfig").msgclass - KerberosConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KerberosConfig").msgclass - IdentityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.IdentityConfig").msgclass - SoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SoftwareConfig").msgclass - LifecycleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LifecycleConfig").msgclass - MetastoreConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.MetastoreConfig").msgclass - ClusterMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterMetrics").msgclass - DataprocMetricConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig").msgclass - DataprocMetricConfig::Metric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.Metric").msgclass - DataprocMetricConfig::MetricSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource").enummodule - CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateClusterRequest").msgclass - UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateClusterRequest").msgclass - StopClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StopClusterRequest").msgclass - StartClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.StartClusterRequest").msgclass - DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteClusterRequest").msgclass - GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetClusterRequest").msgclass - ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersRequest").msgclass - ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListClustersResponse").msgclass - DiagnoseClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest").msgclass - DiagnoseClusterRequest::TarballAccess = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess").enummodule - DiagnoseClusterResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DiagnoseClusterResults").msgclass - ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity").msgclass - ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ReservationAffinity.Type").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb deleted file mode 100644 index 36ce47da9e47..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/clusters_services_pb.rb +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/clusters.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/clusters_pb' - -module Google - module Cloud - module Dataproc - module V1 - module ClusterController - # The ClusterControllerService provides methods to manage clusters - # of Compute Engine instances. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.ClusterController' - - # Creates a cluster in a project. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - rpc :CreateCluster, ::Google::Cloud::Dataproc::V1::CreateClusterRequest, ::Google::Longrunning::Operation - # Updates a cluster in a project. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # The cluster must be in a - # [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error - # is returned. - rpc :UpdateCluster, ::Google::Cloud::Dataproc::V1::UpdateClusterRequest, ::Google::Longrunning::Operation - # Stops a cluster in a project. - rpc :StopCluster, ::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Google::Longrunning::Operation - # Starts a cluster in a project. - rpc :StartCluster, ::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Google::Longrunning::Operation - # Deletes a cluster in a project. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - rpc :DeleteCluster, ::Google::Cloud::Dataproc::V1::DeleteClusterRequest, ::Google::Longrunning::Operation - # Gets the resource representation for a cluster in a project. - rpc :GetCluster, ::Google::Cloud::Dataproc::V1::GetClusterRequest, ::Google::Cloud::Dataproc::V1::Cluster - # Lists all regions/{region}/clusters in a project alphabetically. - rpc :ListClusters, ::Google::Cloud::Dataproc::V1::ListClustersRequest, ::Google::Cloud::Dataproc::V1::ListClustersResponse - # Gets cluster diagnostic information. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] will be - # [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - # After the operation completes, - # [Operation.response][google.longrunning.Operation.response] - # contains - # [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - rpc :DiagnoseCluster, ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb deleted file mode 100644 index 65b0d56ce51c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/job_controller/credentials" -require "google/cloud/dataproc/v1/job_controller/operations" -require "google/cloud/dataproc/v1/job_controller/client" -require "google/cloud/dataproc/v1/job_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The JobController provides methods to manage jobs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/job_controller" - # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/job_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - module JobController - end - end - end - end -end - -helper_path = ::File.join __dir__, "job_controller", "helpers.rb" -require "google/cloud/dataproc/v1/job_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb deleted file mode 100644 index 66606eeeb67d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/client.rb +++ /dev/null @@ -1,1192 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/jobs_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - ## - # Client for the JobController service. - # - # The JobController provides methods to manage jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :job_controller_stub - - ## - # Configure the JobController Client class. - # - # See {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobController clients - # ::Google::Cloud::Dataproc::V1::JobController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.submit_job.timeout = 900.0 - default_config.rpcs.submit_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.submit_job_as_operation.timeout = 900.0 - default_config.rpcs.submit_job_as_operation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_job.timeout = 900.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.list_jobs.timeout = 900.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.update_job.timeout = 900.0 - default_config.rpcs.update_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.cancel_job.timeout = 900.0 - default_config.rpcs.cancel_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.delete_job.timeout = 900.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @job_controller_stub.universe_domain - end - - ## - # Create a new JobController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/jobs_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @job_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::JobController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @job_controller_stub.endpoint - config.universe_domain = @job_controller_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::JobController::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Submits a job to a cluster. - # - # @overload submit_job(request, options = nil) - # Pass arguments to `submit_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload submit_job(project_id: nil, region: nil, job: nil, request_id: nil) - # Pass arguments to `submit_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The job resource. - # @param request_id [::String] - # Optional. A unique id used to identify the request. If the server - # receives two - # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend - # is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - # - # # Call the submit_job method. - # result = client.submit_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def submit_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.submit_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.submit_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.submit_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :submit_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Submits job to a cluster. - # - # @overload submit_job_as_operation(request, options = nil) - # Pass arguments to `submit_job_as_operation` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload submit_job_as_operation(project_id: nil, region: nil, job: nil, request_id: nil) - # Pass arguments to `submit_job_as_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The job resource. - # @param request_id [::String] - # Optional. A unique id used to identify the request. If the server - # receives two - # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend - # is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - # - # # Call the submit_job_as_operation method. - # result = client.submit_job_as_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def submit_job_as_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.submit_job_as_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.submit_job_as_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :submit_job_as_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a job in a project. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.job_id - header_params["job_id"] = request.job_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists regions/\\{region}/jobs in a project. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(project_id: nil, region: nil, page_size: nil, page_token: nil, cluster_name: nil, job_state_matcher: nil, filter: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param page_size [::Integer] - # Optional. The number of results to return in each response. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # @param cluster_name [::String] - # Optional. If set, the returned jobs list includes only jobs that were - # submitted to the named cluster. - # @param job_state_matcher [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] - # Optional. Specifies enumerated categories of jobs to list. - # (default = match ALL jobs). - # - # If `filter` is provided, `jobStateMatcher` will be ignored. - # @param filter [::String] - # Optional. A filter constraining the jobs to list. Filters are - # case-sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - # - # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - # key. **value** can be `*` to match all values. - # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND labels.env = staging AND labels.starred = * - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @job_controller_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a job in a project. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_job(project_id: nil, region: nil, job_id: nil, job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The changes to the job. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the path, relative to Job, of - # the field to update. For example, to update the labels of a Job the - # update_mask parameter would be specified as - # labels, and the `PATCH` request body would specify the new - # value. Note: Currently, labels is the only - # field that can be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.job_id - header_params["job_id"] = request.job_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :update_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a job cancellation request. To access the job resource - # after cancellation, call - # [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) - # or - # [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). - # - # @overload cancel_job(request, options = nil) - # Pass arguments to `cancel_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CancelJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `cancel_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new - # - # # Call the cancel_job method. - # result = client.cancel_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def cancel_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CancelJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.job_id - header_params["job_id"] = request.job_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :cancel_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the job from the project. If the job is active, the delete fails, - # and the response returns `FAILED_PRECONDITION`. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.project_id - header_params["project_id"] = request.project_id - end - if request.region - header_params["region"] = request.region - end - if request.job_id - header_params["job_id"] = request.job_id - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.call_rpc :delete_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobController API. - # - # This class represents the configuration for JobController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::JobController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # submit_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::JobController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.submit_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.submit_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the JobController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `submit_job` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_job - ## - # RPC-specific configuration for `submit_job_as_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_job_as_operation - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `cancel_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - - # @private - def initialize parent_rpcs = nil - submit_job_config = parent_rpcs.submit_job if parent_rpcs.respond_to? :submit_job - @submit_job = ::Gapic::Config::Method.new submit_job_config - submit_job_as_operation_config = parent_rpcs.submit_job_as_operation if parent_rpcs.respond_to? :submit_job_as_operation - @submit_job_as_operation = ::Gapic::Config::Method.new submit_job_as_operation_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job - @cancel_job = ::Gapic::Config::Method.new cancel_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb deleted file mode 100644 index ac4f12b250f6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - # Credentials for the JobController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb deleted file mode 100644 index ba74df48decd..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the JobController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb deleted file mode 100644 index c0f777614652..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/job_controller/credentials" -require "google/cloud/dataproc/v1/job_controller/rest/operations" -require "google/cloud/dataproc/v1/job_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The JobController provides methods to manage jobs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/job_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - module JobController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/job_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb deleted file mode 100644 index a29db22313ca..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/client.rb +++ /dev/null @@ -1,1092 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/jobs_pb" -require "google/cloud/dataproc/v1/job_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - module Rest - ## - # REST client for the JobController service. - # - # The JobController provides methods to manage jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :job_controller_stub - - ## - # Configure the JobController Client class. - # - # See {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all JobController clients - # ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.submit_job.timeout = 900.0 - default_config.rpcs.submit_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.submit_job_as_operation.timeout = 900.0 - default_config.rpcs.submit_job_as_operation.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_job.timeout = 900.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.list_jobs.timeout = 900.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.update_job.timeout = 900.0 - default_config.rpcs.update_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.cancel_job.timeout = 900.0 - default_config.rpcs.cancel_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.delete_job.timeout = 900.0 - default_config.rpcs.delete_job.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the JobController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @job_controller_stub.universe_domain - end - - ## - # Create a new JobController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the JobController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @job_controller_stub = ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @job_controller_stub.endpoint - config.universe_domain = @job_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::JobController::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Submits a job to a cluster. - # - # @overload submit_job(request, options = nil) - # Pass arguments to `submit_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload submit_job(project_id: nil, region: nil, job: nil, request_id: nil) - # Pass arguments to `submit_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The job resource. - # @param request_id [::String] - # Optional. A unique id used to identify the request. If the server - # receives two - # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend - # is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - # - # # Call the submit_job method. - # result = client.submit_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def submit_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.submit_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.submit_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.submit_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.submit_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Submits job to a cluster. - # - # @overload submit_job_as_operation(request, options = nil) - # Pass arguments to `submit_job_as_operation` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::SubmitJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload submit_job_as_operation(project_id: nil, region: nil, job: nil, request_id: nil) - # Pass arguments to `submit_job_as_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The job resource. - # @param request_id [::String] - # Optional. A unique id used to identify the request. If the server - # receives two - # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend - # is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - # - # # Call the submit_job_as_operation method. - # result = client.submit_job_as_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def submit_job_as_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::SubmitJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.submit_job_as_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.submit_job_as_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.submit_job_as_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a job in a project. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists regions/\\{region}/jobs in a project. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(project_id: nil, region: nil, page_size: nil, page_token: nil, cluster_name: nil, job_state_matcher: nil, filter: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param page_size [::Integer] - # Optional. The number of results to return in each response. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # @param cluster_name [::String] - # Optional. If set, the returned jobs list includes only jobs that were - # submitted to the named cluster. - # @param job_state_matcher [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] - # Optional. Specifies enumerated categories of jobs to list. - # (default = match ALL jobs). - # - # If `filter` is provided, `jobStateMatcher` will be ignored. - # @param filter [::String] - # Optional. A filter constraining the jobs to list. Filters are - # case-sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - # - # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - # key. **value** can be `*` to match all values. - # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND labels.env = staging AND labels.starred = * - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.list_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @job_controller_stub, :list_jobs, "jobs", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a job in a project. - # - # @overload update_job(request, options = nil) - # Pass arguments to `update_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_job(project_id: nil, region: nil, job_id: nil, job: nil, update_mask: nil) - # Pass arguments to `update_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # @param job [::Google::Cloud::Dataproc::V1::Job, ::Hash] - # Required. The changes to the job. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the path, relative to Job, of - # the field to update. For example, to update the labels of a Job the - # update_mask parameter would be specified as - # labels, and the `PATCH` request body would specify the new - # value. Note: Currently, labels is the only - # field that can be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new - # - # # Call the update_job method. - # result = client.update_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def update_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.update_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts a job cancellation request. To access the job resource - # after cancellation, call - # [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) - # or - # [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). - # - # @overload cancel_job(request, options = nil) - # Pass arguments to `cancel_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CancelJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `cancel_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CancelJobRequest.new - # - # # Call the cancel_job method. - # result = client.cancel_job request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Job. - # p result - # - def cancel_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CancelJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.cancel_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the job from the project. If the job is active, the delete fails, - # and the response returns `FAILED_PRECONDITION`. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(project_id: nil, region: nil, job_id: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param project_id [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @param region [::String] - # Required. The Dataproc region in which to handle the request. - # @param job_id [::String] - # Required. The job ID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::JobController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @job_controller_stub.delete_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the JobController REST API. - # - # This class represents the configuration for JobController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # submit_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.submit_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.submit_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the JobController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `submit_job` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_job - ## - # RPC-specific configuration for `submit_job_as_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_job_as_operation - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `update_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_job - ## - # RPC-specific configuration for `cancel_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - - # @private - def initialize parent_rpcs = nil - submit_job_config = parent_rpcs.submit_job if parent_rpcs.respond_to? :submit_job - @submit_job = ::Gapic::Config::Method.new submit_job_config - submit_job_as_operation_config = parent_rpcs.submit_job_as_operation if parent_rpcs.respond_to? :submit_job_as_operation - @submit_job_as_operation = ::Gapic::Config::Method.new submit_job_as_operation_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job - @update_job = ::Gapic::Config::Method.new update_job_config - cancel_job_config = parent_rpcs.cancel_job if parent_rpcs.respond_to? :cancel_job - @cancel_job = ::Gapic::Config::Method.new cancel_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb deleted file mode 100644 index 6af03e02c266..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the JobController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the JobController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb deleted file mode 100644 index 42f3eed81aec..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/job_controller/rest/service_stub.rb +++ /dev/null @@ -1,497 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/jobs_pb" - -module Google - module Cloud - module Dataproc - module V1 - module JobController - module Rest - ## - # REST service stub for the JobController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the submit_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # A result object deserialized from the server's reply - def submit_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_submit_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the submit_job_as_operation REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def submit_job_as_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_submit_job_as_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # A result object deserialized from the server's reply - def update_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CancelJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Job] - # A result object deserialized from the server's reply - def cancel_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the submit_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_submit_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs:submit", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the submit_job_as_operation REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::SubmitJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_submit_job_as_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["job_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - body: "job", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["job_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CancelJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", - body: "*", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["job_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - matches: [ - ["project_id", %r{^[^/]+/?$}, false], - ["region", %r{^[^/]+/?$}, false], - ["job_id", %r{^[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb deleted file mode 100644 index 29e3bde715b5..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/jobs.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n#google/cloud/dataproc/v1/jobs.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x02\n\rLoggingConfig\x12W\n\x11\x64river_log_levels\x18\x02 \x03(\x0b\x32<.google.cloud.dataproc.v1.LoggingConfig.DriverLogLevelsEntry\x1a\x65\n\x14\x44riverLogLevelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0e\x32-.google.cloud.dataproc.v1.LoggingConfig.Level:\x02\x38\x01\"p\n\x05Level\x12\x15\n\x11LEVEL_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41LL\x10\x01\x12\t\n\x05TRACE\x10\x02\x12\t\n\x05\x44\x45\x42UG\x10\x03\x12\x08\n\x04INFO\x10\x04\x12\x08\n\x04WARN\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\t\n\x05\x46\x41TAL\x10\x07\x12\x07\n\x03OFF\x10\x08\"\xf1\x02\n\tHadoopJob\x12\x1b\n\x11main_jar_file_uri\x18\x01 \x01(\tH\x00\x12\x14\n\nmain_class\x18\x02 \x01(\tH\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x07 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.HadoopJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x64river\"\xef\x02\n\x08SparkJob\x12\x1b\n\x11main_jar_file_uri\x18\x01 \x01(\tH\x00\x12\x14\n\nmain_class\x18\x02 \x01(\tH\x00\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12K\n\nproperties\x18\x07 \x03(\x0b\x32\x32.google.cloud.dataproc.v1.SparkJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x08\n\x06\x64river\"\xf8\x02\n\nPySparkJob\x12!\n\x14main_python_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1d\n\x10python_file_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12M\n\nproperties\x18\x07 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.PySparkJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x08 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"!\n\tQueryList\x12\x14\n\x07queries\x18\x01 \x03(\tB\x03\xe0\x41\x02\"\xb5\x03\n\x07HiveJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12U\n\x10script_variables\x18\x04 \x03(\x0b\x32\x36.google.cloud.dataproc.v1.HiveJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12J\n\nproperties\x18\x05 \x03(\x0b\x32\x31.google.cloud.dataproc.v1.HiveJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xe5\x03\n\x0bSparkSqlJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12Y\n\x10script_variables\x18\x03 \x03(\x0b\x32:.google.cloud.dataproc.v1.SparkSqlJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12N\n\nproperties\x18\x04 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.SparkSqlJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x38 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x06 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xf8\x03\n\x06PigJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12T\n\x10script_variables\x18\x04 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.PigJob.ScriptVariablesEntryB\x03\xe0\x41\x01\x12I\n\nproperties\x18\x05 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.PigJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x1a\n\rjar_file_uris\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x36\n\x14ScriptVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xb6\x02\n\tSparkRJob\x12\x1c\n\x0fmain_r_file_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x61rgs\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tfile_uris\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61rchive_uris\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x05 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.SparkRJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x06 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8a\x03\n\tPrestoJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\routput_format\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63lient_tags\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12L\n\nproperties\x18\x06 \x03(\x0b\x32\x33.google.cloud.dataproc.v1.PrestoJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\x88\x03\n\x08TrinoJob\x12\x18\n\x0equery_file_uri\x18\x01 \x01(\tH\x00\x12\x39\n\nquery_list\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.QueryListH\x00\x12 \n\x13\x63ontinue_on_failure\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\routput_format\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x63lient_tags\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12K\n\nproperties\x18\x06 \x03(\x0b\x32\x32.google.cloud.dataproc.v1.TrinoJob.PropertiesEntryB\x03\xe0\x41\x01\x12\x44\n\x0elogging_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.LoggingConfigB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\t\n\x07queries\"\xd2\x01\n\x0cJobPlacement\x12\x19\n\x0c\x63luster_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x63luster_uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12V\n\x0e\x63luster_labels\x18\x03 \x03(\x0b\x32\x39.google.cloud.dataproc.v1.JobPlacement.ClusterLabelsEntryB\x03\xe0\x41\x01\x1a\x34\n\x12\x43lusterLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xd9\x03\n\tJobStatus\x12=\n\x05state\x18\x01 \x01(\x0e\x32).google.cloud.dataproc.v1.JobStatus.StateB\x03\xe0\x41\x03\x12\x17\n\x07\x64\x65tails\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12\x39\n\x10state_start_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x08substate\x18\x07 \x01(\x0e\x32,.google.cloud.dataproc.v1.JobStatus.SubstateB\x03\xe0\x41\x03\"\xa9\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0e\n\nSETUP_DONE\x10\x08\x12\x0b\n\x07RUNNING\x10\x02\x12\x12\n\x0e\x43\x41NCEL_PENDING\x10\x03\x12\x12\n\x0e\x43\x41NCEL_STARTED\x10\x07\x12\r\n\tCANCELLED\x10\x04\x12\x08\n\x04\x44ONE\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\x13\n\x0f\x41TTEMPT_FAILURE\x10\t\"H\n\x08Substate\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\r\n\tSUBMITTED\x10\x01\x12\n\n\x06QUEUED\x10\x02\x12\x10\n\x0cSTALE_STATUS\x10\x03\"<\n\x0cJobReference\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa5\x02\n\x0fYarnApplication\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x05state\x18\x02 \x01(\x0e\x32/.google.cloud.dataproc.v1.YarnApplication.StateB\x03\xe0\x41\x02\x12\x15\n\x08progress\x18\x03 \x01(\x02\x42\x03\xe0\x41\x02\x12\x19\n\x0ctracking_url\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x0e\n\nNEW_SAVING\x10\x02\x12\r\n\tSUBMITTED\x10\x03\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x04\x12\x0b\n\x07RUNNING\x10\x05\x12\x0c\n\x08\x46INISHED\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\n\n\x06KILLED\x10\x08\"\x96\n\n\x03Job\x12>\n\treference\x18\x01 \x01(\x0b\x32&.google.cloud.dataproc.v1.JobReferenceB\x03\xe0\x41\x01\x12>\n\tplacement\x18\x02 \x01(\x0b\x32&.google.cloud.dataproc.v1.JobPlacementB\x03\xe0\x41\x02\x12>\n\nhadoop_job\x18\x03 \x01(\x0b\x32#.google.cloud.dataproc.v1.HadoopJobB\x03\xe0\x41\x01H\x00\x12<\n\tspark_job\x18\x04 \x01(\x0b\x32\".google.cloud.dataproc.v1.SparkJobB\x03\xe0\x41\x01H\x00\x12@\n\x0bpyspark_job\x18\x05 \x01(\x0b\x32$.google.cloud.dataproc.v1.PySparkJobB\x03\xe0\x41\x01H\x00\x12:\n\x08hive_job\x18\x06 \x01(\x0b\x32!.google.cloud.dataproc.v1.HiveJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x07pig_job\x18\x07 \x01(\x0b\x32 .google.cloud.dataproc.v1.PigJobB\x03\xe0\x41\x01H\x00\x12?\n\x0bspark_r_job\x18\x15 \x01(\x0b\x32#.google.cloud.dataproc.v1.SparkRJobB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_sql_job\x18\x0c \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkSqlJobB\x03\xe0\x41\x01H\x00\x12>\n\npresto_job\x18\x17 \x01(\x0b\x32#.google.cloud.dataproc.v1.PrestoJobB\x03\xe0\x41\x01H\x00\x12<\n\ttrino_job\x18\x1c \x01(\x0b\x32\".google.cloud.dataproc.v1.TrinoJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x06status\x18\x08 \x01(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12@\n\x0estatus_history\x18\r \x03(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12I\n\x11yarn_applications\x18\t \x03(\x0b\x32).google.cloud.dataproc.v1.YarnApplicationB\x03\xe0\x41\x03\x12\'\n\x1a\x64river_output_resource_uri\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12%\n\x18\x64river_control_files_uri\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x12 \x03(\x0b\x32).google.cloud.dataproc.v1.Job.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nscheduling\x18\x14 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JobSchedulingB\x03\xe0\x41\x01\x12\x15\n\x08job_uuid\x18\x16 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x64one\x18\x18 \x01(\x08\x42\x03\xe0\x41\x03\x12W\n\x18\x64river_scheduling_config\x18\x1b \x01(\x0b\x32\x30.google.cloud.dataproc.v1.DriverSchedulingConfigB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08type_job\"E\n\x16\x44riverSchedulingConfig\x12\x16\n\tmemory_mb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x13\n\x06vcores\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\"T\n\rJobScheduling\x12\"\n\x15max_failures_per_hour\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1f\n\x12max_failures_total\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\x8a\x01\n\x10SubmitJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12/\n\x03job\x18\x02 \x01(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xae\x01\n\x0bJobMetadata\x12\x13\n\x06job_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x38\n\x06status\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.JobStatusB\x03\xe0\x41\x03\x12\x1b\n\x0eoperation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"R\n\rGetJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xb3\x02\n\x0fListJobsRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x63luster_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x11job_state_matcher\x18\x05 \x01(\x0e\x32\x39.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcherB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x07 \x01(\tB\x03\xe0\x41\x01\"6\n\x0fJobStateMatcher\x12\x07\n\x03\x41LL\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0e\n\nNON_ACTIVE\x10\x02\"\xbc\x01\n\x10UpdateJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12/\n\x03job\x18\x04 \x01(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"b\n\x10ListJobsResponse\x12\x30\n\x04jobs\x18\x01 \x03(\x0b\x32\x1d.google.cloud.dataproc.v1.JobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"U\n\x10\x43\x61ncelJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\"U\n\x10\x44\x65leteJobRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06region\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x32\xfc\n\n\rJobController\x12\xb1\x01\n\tSubmitJob\x12*.google.cloud.dataproc.v1.SubmitJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"Y\xda\x41\x15project_id,region,job\x82\xd3\xe4\x93\x02;\"6/v1/projects/{project_id}/regions/{region}/jobs:submit:\x01*\x12\xde\x01\n\x14SubmitJobAsOperation\x12*.google.cloud.dataproc.v1.SubmitJobRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x12\n\x03Job\x12\x0bJobMetadata\xda\x41\x17project_id, region, job\x82\xd3\xe4\x93\x02\x46\"A/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation:\x01*\x12\xad\x01\n\x06GetJob\x12\'.google.cloud.dataproc.v1.GetJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"[\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02:\x12\x38/v1/projects/{project_id}/regions/{region}/jobs/{job_id}\x12\xc9\x01\n\x08ListJobs\x12).google.cloud.dataproc.v1.ListJobsRequest\x1a*.google.cloud.dataproc.v1.ListJobsResponse\"f\xda\x41\x11project_id,region\xda\x41\x18project_id,region,filter\x82\xd3\xe4\x93\x02\x31\x12//v1/projects/{project_id}/regions/{region}/jobs\x12\x9d\x01\n\tUpdateJob\x12*.google.cloud.dataproc.v1.UpdateJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"E\x82\xd3\xe4\x93\x02?28/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:\x03job\x12\xbd\x01\n\tCancelJob\x12*.google.cloud.dataproc.v1.CancelJobRequest\x1a\x1d.google.cloud.dataproc.v1.Job\"e\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02\x44\"?/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel:\x01*\x12\xac\x01\n\tDeleteJob\x12*.google.cloud.dataproc.v1.DeleteJobRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x18project_id,region,job_id\x82\xd3\xe4\x93\x02:*8/v1/projects/{project_id}/regions/{region}/jobs/{job_id}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBh\n\x1c\x63om.google.cloud.dataproc.v1B\tJobsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LoggingConfig").msgclass - LoggingConfig::Level = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.LoggingConfig.Level").enummodule - HadoopJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.HadoopJob").msgclass - SparkJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkJob").msgclass - PySparkJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PySparkJob").msgclass - QueryList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.QueryList").msgclass - HiveJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.HiveJob").msgclass - SparkSqlJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkSqlJob").msgclass - PigJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PigJob").msgclass - SparkRJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkRJob").msgclass - PrestoJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PrestoJob").msgclass - TrinoJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.TrinoJob").msgclass - JobPlacement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobPlacement").msgclass - JobStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus").msgclass - JobStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus.State").enummodule - JobStatus::Substate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobStatus.Substate").enummodule - JobReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobReference").msgclass - YarnApplication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.YarnApplication").msgclass - YarnApplication::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.YarnApplication.State").enummodule - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Job").msgclass - DriverSchedulingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DriverSchedulingConfig").msgclass - JobScheduling = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobScheduling").msgclass - SubmitJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SubmitJobRequest").msgclass - JobMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JobMetadata").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetJobRequest").msgclass - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsRequest").msgclass - ListJobsRequest::JobStateMatcher = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher").enummodule - UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateJobRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListJobsResponse").msgclass - CancelJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CancelJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteJobRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb deleted file mode 100644 index 135eef3d215d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/jobs_services_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/jobs.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/jobs_pb' - -module Google - module Cloud - module Dataproc - module V1 - module JobController - # The JobController provides methods to manage jobs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.JobController' - - # Submits a job to a cluster. - rpc :SubmitJob, ::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Google::Cloud::Dataproc::V1::Job - # Submits job to a cluster. - rpc :SubmitJobAsOperation, ::Google::Cloud::Dataproc::V1::SubmitJobRequest, ::Google::Longrunning::Operation - # Gets the resource representation for a job in a project. - rpc :GetJob, ::Google::Cloud::Dataproc::V1::GetJobRequest, ::Google::Cloud::Dataproc::V1::Job - # Lists regions/{region}/jobs in a project. - rpc :ListJobs, ::Google::Cloud::Dataproc::V1::ListJobsRequest, ::Google::Cloud::Dataproc::V1::ListJobsResponse - # Updates a job in a project. - rpc :UpdateJob, ::Google::Cloud::Dataproc::V1::UpdateJobRequest, ::Google::Cloud::Dataproc::V1::Job - # Starts a job cancellation request. To access the job resource - # after cancellation, call - # [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) - # or - # [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). - rpc :CancelJob, ::Google::Cloud::Dataproc::V1::CancelJobRequest, ::Google::Cloud::Dataproc::V1::Job - # Deletes the job from the project. If the job is active, the delete fails, - # and the response returns `FAILED_PRECONDITION`. - rpc :DeleteJob, ::Google::Cloud::Dataproc::V1::DeleteJobRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb deleted file mode 100644 index fee7963fff6b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/node_group_controller/credentials" -require "google/cloud/dataproc/v1/node_group_controller/paths" -require "google/cloud/dataproc/v1/node_group_controller/operations" -require "google/cloud/dataproc/v1/node_group_controller/client" -require "google/cloud/dataproc/v1/node_group_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The `NodeGroupControllerService` provides methods to manage node groups - # of Compute Engine managed instances. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/node_group_controller" - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/node_group_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - module NodeGroupController - end - end - end - end -end - -helper_path = ::File.join __dir__, "node_group_controller", "helpers.rb" -require "google/cloud/dataproc/v1/node_group_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb deleted file mode 100644 index a200b454d2d9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/client.rb +++ /dev/null @@ -1,718 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/node_groups_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - ## - # Client for the NodeGroupController service. - # - # The `NodeGroupControllerService` provides methods to manage node groups - # of Compute Engine managed instances. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :node_group_controller_stub - - ## - # Configure the NodeGroupController Client class. - # - # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all NodeGroupController clients - # ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the NodeGroupController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @node_group_controller_stub.universe_domain - end - - ## - # Create a new NodeGroupController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the NodeGroupController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/node_groups_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @node_group_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::NodeGroupController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @node_group_controller_stub.endpoint - config.universe_domain = @node_group_controller_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::NodeGroupController::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a node group in a cluster. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - # - # @overload create_node_group(request, options = nil) - # Pass arguments to `create_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_node_group(parent: nil, node_group: nil, node_group_id: nil, request_id: nil) - # Pass arguments to `create_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this node group will be created. - # Format: `projects/{project}/regions/{region}/clusters/{cluster}` - # @param node_group [::Google::Cloud::Dataproc::V1::NodeGroup, ::Hash] - # Required. The node group to create. - # @param node_group_id [::String] - # Optional. An optional node group ID. Generated if not specified. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of from 3 to 33 characters. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new - # - # # Call the create_node_group method. - # result = client.create_node_group request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_node_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.call_rpc :create_node_group, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resizes a node group in a cluster. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - # - # @overload resize_node_group(request, options = nil) - # Pass arguments to `resize_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resize_node_group(name: nil, size: nil, request_id: nil, graceful_decommission_timeout: nil) - # Pass arguments to `resize_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the node group to resize. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - # @param size [::Integer] - # Required. The number of running instances for the node group to maintain. - # The group adds or removes instances to maintain the number of instances - # specified by this parameter. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] - # Optional. Timeout for graceful YARN decommissioning. [Graceful - # decommissioning] - # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - # allows the removal of nodes from the Compute Engine node group - # without interrupting jobs in progress. This timeout specifies how long to - # wait for jobs in progress to finish before forcefully removing nodes (and - # potentially interrupting jobs). Default timeout is 0 (for forceful - # decommission), and the maximum allowed timeout is 1 day. (see JSON - # representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new - # - # # Call the resize_node_group method. - # result = client.resize_node_group request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def resize_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.resize_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resize_node_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resize_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.call_rpc :resize_node_group, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a node group in a - # cluster. - # - # @overload get_node_group(request, options = nil) - # Pass arguments to `get_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_node_group(name: nil) - # Pass arguments to `get_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the node group to retrieve. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::NodeGroup] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::NodeGroup] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new - # - # # Call the get_node_group method. - # result = client.get_node_group request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. - # p result - # - def get_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_node_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.call_rpc :get_node_group, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the NodeGroupController API. - # - # This class represents the configuration for NodeGroupController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_node_group to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_node_group.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_node_group.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the NodeGroupController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_node_group - ## - # RPC-specific configuration for `resize_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :resize_node_group - ## - # RPC-specific configuration for `get_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node_group - - # @private - def initialize parent_rpcs = nil - create_node_group_config = parent_rpcs.create_node_group if parent_rpcs.respond_to? :create_node_group - @create_node_group = ::Gapic::Config::Method.new create_node_group_config - resize_node_group_config = parent_rpcs.resize_node_group if parent_rpcs.respond_to? :resize_node_group - @resize_node_group = ::Gapic::Config::Method.new resize_node_group_config - get_node_group_config = parent_rpcs.get_node_group if parent_rpcs.respond_to? :get_node_group - @get_node_group = ::Gapic::Config::Method.new get_node_group_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb deleted file mode 100644 index 9be95d9e37b7..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - # Credentials for the NodeGroupController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb deleted file mode 100644 index 96350ea26db8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the NodeGroupController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the NodeGroupController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb deleted file mode 100644 index 885e4524f2c8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/paths.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - # Path helper methods for the NodeGroupController API. - module Paths - ## - # Create a fully-qualified ClusterRegion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/clusters/{cluster}` - # - # @param project [String] - # @param region [String] - # @param cluster [String] - # - # @return [::String] - def cluster_region_path project:, region:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified NodeGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` - # - # @param project [String] - # @param region [String] - # @param cluster [String] - # @param node_group [String] - # - # @return [::String] - def node_group_path project:, region:, cluster:, node_group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb deleted file mode 100644 index 05cf198c7fd1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/node_group_controller/credentials" -require "google/cloud/dataproc/v1/node_group_controller/paths" -require "google/cloud/dataproc/v1/node_group_controller/rest/operations" -require "google/cloud/dataproc/v1/node_group_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The `NodeGroupControllerService` provides methods to manage node groups - # of Compute Engine managed instances. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/node_group_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - module NodeGroupController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/node_group_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb deleted file mode 100644 index 4d201529afdb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/client.rb +++ /dev/null @@ -1,679 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/node_groups_pb" -require "google/cloud/dataproc/v1/node_group_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - module Rest - ## - # REST client for the NodeGroupController service. - # - # The `NodeGroupControllerService` provides methods to manage node groups - # of Compute Engine managed instances. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :node_group_controller_stub - - ## - # Configure the NodeGroupController Client class. - # - # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all NodeGroupController clients - # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the NodeGroupController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @node_group_controller_stub.universe_domain - end - - ## - # Create a new NodeGroupController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the NodeGroupController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @node_group_controller_stub = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @node_group_controller_stub.endpoint - config.universe_domain = @node_group_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates a node group in a cluster. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - # - # @overload create_node_group(request, options = nil) - # Pass arguments to `create_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_node_group(parent: nil, node_group: nil, node_group_id: nil, request_id: nil) - # Pass arguments to `create_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this node group will be created. - # Format: `projects/{project}/regions/{region}/clusters/{cluster}` - # @param node_group [::Google::Cloud::Dataproc::V1::NodeGroup, ::Hash] - # Required. The node group to create. - # @param node_group_id [::String] - # Optional. An optional node group ID. Generated if not specified. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of from 3 to 33 characters. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new - # - # # Call the create_node_group method. - # result = client.create_node_group request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_node_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.create_node_group request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resizes a node group in a cluster. The returned - # {::Google::Longrunning::Operation#metadata Operation.metadata} is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - # - # @overload resize_node_group(request, options = nil) - # Pass arguments to `resize_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resize_node_group(name: nil, size: nil, request_id: nil, graceful_decommission_timeout: nil) - # Pass arguments to `resize_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the node group to resize. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - # @param size [::Integer] - # Required. The number of running instances for the node group to maintain. - # The group adds or removes instances to maintain the number of instances - # specified by this parameter. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param graceful_decommission_timeout [::Google::Protobuf::Duration, ::Hash] - # Optional. Timeout for graceful YARN decommissioning. [Graceful - # decommissioning] - # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - # allows the removal of nodes from the Compute Engine node group - # without interrupting jobs in progress. This timeout specifies how long to - # wait for jobs in progress to finish before forcefully removing nodes (and - # potentially interrupting jobs). Default timeout is 0 (for forceful - # decommission), and the maximum allowed timeout is 1 day. (see JSON - # representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new - # - # # Call the resize_node_group method. - # result = client.resize_node_group request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def resize_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.resize_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.resize_node_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resize_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.resize_node_group request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a node group in a - # cluster. - # - # @overload get_node_group(request, options = nil) - # Pass arguments to `get_node_group` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetNodeGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_node_group(name: nil) - # Pass arguments to `get_node_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the node group to retrieve. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::NodeGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::NodeGroup] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new - # - # # Call the get_node_group method. - # result = client.get_node_group request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. - # p result - # - def get_node_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_node_group.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_node_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_node_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @node_group_controller_stub.get_node_group request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the NodeGroupController REST API. - # - # This class represents the configuration for NodeGroupController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_node_group to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_node_group.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_node_group.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the NodeGroupController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_node_group - ## - # RPC-specific configuration for `resize_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :resize_node_group - ## - # RPC-specific configuration for `get_node_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node_group - - # @private - def initialize parent_rpcs = nil - create_node_group_config = parent_rpcs.create_node_group if parent_rpcs.respond_to? :create_node_group - @create_node_group = ::Gapic::Config::Method.new create_node_group_config - resize_node_group_config = parent_rpcs.resize_node_group if parent_rpcs.respond_to? :resize_node_group - @resize_node_group = ::Gapic::Config::Method.new resize_node_group_config - get_node_group_config = parent_rpcs.get_node_group if parent_rpcs.respond_to? :get_node_group - @get_node_group = ::Gapic::Config::Method.new get_node_group_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb deleted file mode 100644 index 28876f4f1628..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the NodeGroupController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the NodeGroupController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb deleted file mode 100644 index ebede911fa7e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_group_controller/rest/service_stub.rb +++ /dev/null @@ -1,248 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/node_groups_pb" - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - module Rest - ## - # REST service stub for the NodeGroupController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_node_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_node_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the resize_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def resize_node_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resize_node_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::NodeGroup] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::NodeGroup] - # A result object deserialized from the server's reply - def get_node_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_node_group_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::NodeGroup.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_node_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/nodeGroups", - body: "node_group", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resize_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resize_node_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:resize", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/nodeGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_node_group REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetNodeGroupRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_node_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/clusters/[^/]+/nodeGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb deleted file mode 100644 index 0d14395e4f9d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/node_groups.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/clusters_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n*google/cloud/dataproc/v1/node_groups.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/clusters.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\"\xc6\x01\n\x16\x43reateNodeGroupRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dataproc.googleapis.com/NodeGroup\x12<\n\nnode_group\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.NodeGroupB\x03\xe0\x41\x02\x12\x1a\n\rnode_group_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x16ResizeNodeGroupRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x1dgraceful_decommission_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"N\n\x13GetNodeGroupRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dataproc.googleapis.com/NodeGroup2\xa7\x06\n\x13NodeGroupController\x12\x95\x02\n\x0f\x43reateNodeGroup\x12\x30.google.cloud.dataproc.v1.CreateNodeGroupRequest\x1a\x1d.google.longrunning.Operation\"\xb0\x01\xca\x41@\n\tNodeGroup\x12\x33google.cloud.dataproc.v1.NodeGroupOperationMetadata\xda\x41\x1fparent,node_group,node_group_id\x82\xd3\xe4\x93\x02\x45\"7/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups:\nnode_group\x12\xfd\x01\n\x0fResizeNodeGroup\x12\x30.google.cloud.dataproc.v1.ResizeNodeGroupRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41@\n\tNodeGroup\x12\x33google.cloud.dataproc.v1.NodeGroupOperationMetadata\xda\x41\tname,size\x82\xd3\xe4\x93\x02\x43\">/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize:\x01*\x12\xaa\x01\n\x0cGetNodeGroup\x12-.google.cloud.dataproc.v1.GetNodeGroupRequest\x1a#.google.cloud.dataproc.v1.NodeGroup\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd0\x01\n\x1c\x63om.google.cloud.dataproc.v1B\x0fNodeGroupsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb\xea\x41_\n%dataproc.googleapis.com/ClusterRegion\x12\x36projects/{project}/regions/{region}/clusters/{cluster}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.dataproc.v1.NodeGroup", "google/cloud/dataproc/v1/clusters.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - CreateNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateNodeGroupRequest").msgclass - ResizeNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ResizeNodeGroupRequest").msgclass - GetNodeGroupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetNodeGroupRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb deleted file mode 100644 index 2bcb49d1f6c4..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/node_groups_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/node_groups.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/node_groups_pb' - -module Google - module Cloud - module Dataproc - module V1 - module NodeGroupController - # The `NodeGroupControllerService` provides methods to manage node groups - # of Compute Engine managed instances. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.NodeGroupController' - - # Creates a node group in a cluster. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - rpc :CreateNodeGroup, ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, ::Google::Longrunning::Operation - # Resizes a node group in a cluster. The returned - # [Operation.metadata][google.longrunning.Operation.metadata] is - # [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - rpc :ResizeNodeGroup, ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, ::Google::Longrunning::Operation - # Gets the resource representation for a node group in a - # cluster. - rpc :GetNodeGroup, ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, ::Google::Cloud::Dataproc::V1::NodeGroup - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb deleted file mode 100644 index 37fd96628b23..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/operations_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/operations.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/cloud/dataproc/v1/operations.proto\x12\x18google.cloud.dataproc.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe3\x03\n\x16\x42\x61tchOperationMetadata\x12\r\n\x05\x62\x61tch\x18\x01 \x01(\t\x12\x12\n\nbatch_uuid\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12[\n\x0eoperation_type\x18\x06 \x01(\x0e\x32\x43.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12L\n\x06labels\x18\x08 \x03(\x0b\x32<.google.cloud.dataproc.v1.BatchOperationMetadata.LabelsEntry\x12\x10\n\x08warnings\x18\t \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"E\n\x12\x42\x61tchOperationType\x12$\n BATCH_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41TCH\x10\x01\"\x8f\x04\n\x18SessionOperationMetadata\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x14\n\x0csession_uuid\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12_\n\x0eoperation_type\x18\x06 \x01(\x0e\x32G.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12N\n\x06labels\x18\x08 \x03(\x0b\x32>.google.cloud.dataproc.v1.SessionOperationMetadata.LabelsEntry\x12\x10\n\x08warnings\x18\t \x03(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"e\n\x14SessionOperationType\x12&\n\"SESSION_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\r\n\tTERMINATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\"\x89\x02\n\x16\x43lusterOperationStatus\x12J\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.dataproc.v1.ClusterOperationStatus.StateB\x03\xe0\x41\x03\x12\x18\n\x0binner_state\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07\x64\x65tails\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"8\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\"\xda\x03\n\x18\x43lusterOperationMetadata\x12\x19\n\x0c\x63luster_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06status\x18\t \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12M\n\x0estatus_history\x18\n \x03(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12\x1b\n\x0eoperation_type\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12S\n\x06labels\x18\r \x03(\x0b\x32>.google.cloud.dataproc.v1.ClusterOperationMetadata.LabelsEntryB\x03\xe0\x41\x03\x12\x15\n\x08warnings\x18\x0e \x03(\tB\x03\xe0\x41\x03\x12 \n\x13\x63hild_operation_ids\x18\x0f \x03(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xfa\x04\n\x1aNodeGroupOperationMetadata\x12\x1a\n\rnode_group_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x45\n\x06status\x18\x03 \x01(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12M\n\x0estatus_history\x18\x04 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.ClusterOperationStatusB\x03\xe0\x41\x03\x12\x63\n\x0eoperation_type\x18\x05 \x01(\x0e\x32K.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12U\n\x06labels\x18\x07 \x03(\x0b\x32@.google.cloud.dataproc.v1.NodeGroupOperationMetadata.LabelsEntryB\x03\xe0\x41\x03\x12\x15\n\x08warnings\x18\x08 \x03(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"s\n\x16NodeGroupOperationType\x12)\n%NODE_GROUP_OPERATION_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\x12\n\n\x06RESIZE\x10\x04\x42n\n\x1c\x63om.google.cloud.dataproc.v1B\x0fOperationsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.BatchOperationMetadata").msgclass - BatchOperationMetadata::BatchOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType").enummodule - SessionOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionOperationMetadata").msgclass - SessionOperationMetadata::SessionOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType").enummodule - ClusterOperationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationStatus").msgclass - ClusterOperationStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationStatus.State").enummodule - ClusterOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ClusterOperationMetadata").msgclass - NodeGroupOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupOperationMetadata").msgclass - NodeGroupOperationMetadata::NodeGroupOperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb deleted file mode 100644 index 24b3017ec96f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/rest.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" -require "google/cloud/dataproc/v1/batch_controller/rest" -require "google/cloud/dataproc/v1/cluster_controller/rest" -require "google/cloud/dataproc/v1/job_controller/rest" -require "google/cloud/dataproc/v1/node_group_controller/rest" -require "google/cloud/dataproc/v1/session_controller/rest" -require "google/cloud/dataproc/v1/session_template_controller/rest" -require "google/cloud/dataproc/v1/workflow_template_service/rest" -require "google/cloud/dataproc/v1/bindings_override" -require "google/cloud/dataproc/v1/version" - -module Google - module Cloud - module Dataproc - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/dataproc/v1/rest" - # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb deleted file mode 100644 index 08601d9fefeb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/session_controller/credentials" -require "google/cloud/dataproc/v1/session_controller/paths" -require "google/cloud/dataproc/v1/session_controller/operations" -require "google/cloud/dataproc/v1/session_controller/client" -require "google/cloud/dataproc/v1/session_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The `SessionController` provides methods to manage interactive sessions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/session_controller" - # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/session_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - module SessionController - end - end - end - end -end - -helper_path = ::File.join __dir__, "session_controller", "helpers.rb" -require "google/cloud/dataproc/v1/session_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb deleted file mode 100644 index 42990cbb6c07..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/client.rb +++ /dev/null @@ -1,920 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/sessions_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - ## - # Client for the SessionController service. - # - # The `SessionController` provides methods to manage interactive sessions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_controller_stub - - ## - # Configure the SessionController Client class. - # - # See {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionController clients - # ::Google::Cloud::Dataproc::V1::SessionController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_controller_stub.universe_domain - end - - ## - # Create a new SessionController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/sessions_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @session_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::SessionController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_controller_stub.endpoint - config.universe_domain = @session_controller_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::SessionController::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Create an interactive session asynchronously. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session(parent: nil, session: nil, session_id: nil, request_id: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this session will be created. - # @param session [::Google::Cloud::Dataproc::V1::Session, ::Hash] - # Required. The interactive session to create. - # @param session_id [::String] - # Required. The ID to use for the session, which becomes the final component - # of the session's resource name. - # - # This value must be 4-63 characters. Valid characters - # are /[a-z][0-9]-/. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - # with the same ID, the second request is ignored, and the - # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in - # the backend. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.call_rpc :create_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for an interactive session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session(name: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::Session] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::Session] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.call_rpc :get_session, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists interactive sessions. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of sessions. - # @param page_size [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @param page_token [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the sessions to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each session resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND, OR). - # Supported fields are `session_id`, `session_uuid`, `state`, and - # `create_time`. - # - # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - # is a filter for sessions in an ACTIVE state that were created before - # 2023-01-01. - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparators. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.call_rpc :list_sessions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @session_controller_stub, :list_sessions, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Terminates the interactive session. - # - # @overload terminate_session(request, options = nil) - # Pass arguments to `terminate_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::TerminateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload terminate_session(name: nil, request_id: nil) - # Pass arguments to `terminate_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session resource to terminate. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new - # - # # Call the terminate_session method. - # result = client.terminate_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def terminate_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::TerminateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.terminate_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.terminate_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.terminate_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.call_rpc :terminate_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the interactive session resource. If the session is not in terminal - # state, it is terminated, and then deleted. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session(name: nil, request_id: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session resource to delete. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.call_rpc :delete_session, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionController API. - # - # This class represents the configuration for SessionController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::SessionController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SessionController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - ## - # RPC-specific configuration for `terminate_session` - # @return [::Gapic::Config::Method] - # - attr_reader :terminate_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - terminate_session_config = parent_rpcs.terminate_session if parent_rpcs.respond_to? :terminate_session - @terminate_session = ::Gapic::Config::Method.new terminate_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb deleted file mode 100644 index d149bb6636cb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - # Credentials for the SessionController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb deleted file mode 100644 index 37acfc698a6d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SessionController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb deleted file mode 100644 index 9f2b6b3cd83f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/paths.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - # Path helper methods for the SessionController API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/services/#{service}" - end - - ## - # Create a fully-qualified Session resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # - # @return [::String] - def session_path project:, location:, session: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sessions/#{session}" - end - - ## - # Create a fully-qualified SessionTemplate resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sessionTemplates/{template}` - # - # @param project [String] - # @param location [String] - # @param template [String] - # - # @return [::String] - def session_template_path project:, location:, template: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sessionTemplates/#{template}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb deleted file mode 100644 index 35b6ab0a73a0..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/session_controller/credentials" -require "google/cloud/dataproc/v1/session_controller/paths" -require "google/cloud/dataproc/v1/session_controller/rest/operations" -require "google/cloud/dataproc/v1/session_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The `SessionController` provides methods to manage interactive sessions. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/session_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - module SessionController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/session_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb deleted file mode 100644 index d3154613eb4a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/client.rb +++ /dev/null @@ -1,867 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/sessions_pb" -require "google/cloud/dataproc/v1/session_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - module Rest - ## - # REST client for the SessionController service. - # - # The `SessionController` provides methods to manage interactive sessions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_controller_stub - - ## - # Configure the SessionController Client class. - # - # See {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionController clients - # ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_controller_stub.universe_domain - end - - ## - # Create a new SessionController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @session_controller_stub = ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_controller_stub.endpoint - config.universe_domain = @session_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::SessionController::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Create an interactive session asynchronously. - # - # @overload create_session(request, options = nil) - # Pass arguments to `create_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_session(parent: nil, session: nil, session_id: nil, request_id: nil) - # Pass arguments to `create_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this session will be created. - # @param session [::Google::Cloud::Dataproc::V1::Session, ::Hash] - # Required. The interactive session to create. - # @param session_id [::String] - # Required. The ID to use for the session, which becomes the final component - # of the session's resource name. - # - # This value must be 4-63 characters. Valid characters - # are /[a-z][0-9]-/. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - # with the same ID, the second request is ignored, and the - # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in - # the backend. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new - # - # # Call the create_session method. - # result = client.create_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.create_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for an interactive session. - # - # @overload get_session(request, options = nil) - # Pass arguments to `get_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_session(name: nil) - # Pass arguments to `get_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Session] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetSessionRequest.new - # - # # Call the get_session method. - # result = client.get_session request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::Session. - # p result - # - def get_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.get_session request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists interactive sessions. - # - # @overload list_sessions(request, options = nil) - # Pass arguments to `list_sessions` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListSessionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_sessions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent, which owns this collection of sessions. - # @param page_size [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @param page_token [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the sessions to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each session resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND, OR). - # Supported fields are `session_id`, `session_uuid`, `state`, and - # `create_time`. - # - # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - # is a filter for sessions in an ACTIVE state that were created before - # 2023-01-01. - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparators. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::Session>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new - # - # # Call the list_sessions method. - # result = client.list_sessions request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::Session. - # p item - # end - # - def list_sessions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_sessions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_sessions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sessions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.list_sessions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @session_controller_stub, :list_sessions, "sessions", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Terminates the interactive session. - # - # @overload terminate_session(request, options = nil) - # Pass arguments to `terminate_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::TerminateSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload terminate_session(name: nil, request_id: nil) - # Pass arguments to `terminate_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session resource to terminate. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new - # - # # Call the terminate_session method. - # result = client.terminate_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def terminate_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::TerminateSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.terminate_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.terminate_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.terminate_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.terminate_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes the interactive session resource. If the session is not in terminal - # state, it is terminated, and then deleted. - # - # @overload delete_session(request, options = nil) - # Pass arguments to `delete_session` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteSessionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_session(name: nil, request_id: nil) - # Pass arguments to `delete_session` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session resource to delete. - # @param request_id [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new - # - # # Call the delete_session method. - # result = client.delete_session request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_session request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_session.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_session.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_session.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_controller_stub.delete_session request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionController REST API. - # - # This class represents the configuration for SessionController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SessionController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session - ## - # RPC-specific configuration for `get_session` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session - ## - # RPC-specific configuration for `list_sessions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sessions - ## - # RPC-specific configuration for `terminate_session` - # @return [::Gapic::Config::Method] - # - attr_reader :terminate_session - ## - # RPC-specific configuration for `delete_session` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session - - # @private - def initialize parent_rpcs = nil - create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session - @create_session = ::Gapic::Config::Method.new create_session_config - get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session - @get_session = ::Gapic::Config::Method.new get_session_config - list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions - @list_sessions = ::Gapic::Config::Method.new list_sessions_config - terminate_session_config = parent_rpcs.terminate_session if parent_rpcs.respond_to? :terminate_session - @terminate_session = ::Gapic::Config::Method.new terminate_session_config - delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session - @delete_session = ::Gapic::Config::Method.new delete_session_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb deleted file mode 100644 index 5a802e99e65e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the SessionController Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionController Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb deleted file mode 100644 index c1fce1800c60..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_controller/rest/service_stub.rb +++ /dev/null @@ -1,366 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/sessions_pb" - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - module Rest - ## - # REST service stub for the SessionController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::Session] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::Session] - # A result object deserialized from the server's reply - def get_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::Session.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListSessionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListSessionsResponse] - # A result object deserialized from the server's reply - def list_sessions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sessions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the terminate_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::TerminateSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def terminate_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_terminate_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_session request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessions", - body: "session", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sessions REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_sessions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the terminate_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::TerminateSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_terminate_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:terminate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_session REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_session_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb deleted file mode 100644 index ced4bf429763..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/session_template_controller/credentials" -require "google/cloud/dataproc/v1/session_template_controller/paths" -require "google/cloud/dataproc/v1/session_template_controller/client" -require "google/cloud/dataproc/v1/session_template_controller/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The SessionTemplateController provides methods to manage session templates. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/session_template_controller" - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/session_template_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - module SessionTemplateController - end - end - end - end -end - -helper_path = ::File.join __dir__, "session_template_controller", "helpers.rb" -require "google/cloud/dataproc/v1/session_template_controller/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb deleted file mode 100644 index aa5114e01620..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/client.rb +++ /dev/null @@ -1,830 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/session_templates_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - ## - # Client for the SessionTemplateController service. - # - # The SessionTemplateController provides methods to manage session templates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_template_controller_stub - - ## - # Configure the SessionTemplateController Client class. - # - # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionTemplateController clients - # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionTemplateController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_template_controller_stub.universe_domain - end - - ## - # Create a new SessionTemplateController client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionTemplateController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/session_templates_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @session_template_controller_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_template_controller_stub.endpoint - config.universe_domain = @session_template_controller_stub.universe_domain - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Create a session template synchronously. - # - # @overload create_session_template(request, options = nil) - # Pass arguments to `create_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_session_template(parent: nil, session_template: nil) - # Pass arguments to `create_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this session template will be created. - # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] - # Required. The session template to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new - # - # # Call the create_session_template method. - # result = client.create_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def create_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_session_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.call_rpc :create_session_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the session template synchronously. - # - # @overload update_session_template(request, options = nil) - # Pass arguments to `update_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_session_template(session_template: nil) - # Pass arguments to `update_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] - # Required. The updated session template. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new - # - # # Call the update_session_template method. - # result = client.update_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def update_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.session_template&.name - header_params["session_template.name"] = request.session_template.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_session_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.call_rpc :update_session_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a session template. - # - # @overload get_session_template(request, options = nil) - # Pass arguments to `get_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_session_template(name: nil) - # Pass arguments to `get_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session template to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new - # - # # Call the get_session_template method. - # result = client.get_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def get_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_session_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.call_rpc :get_session_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists session templates. - # - # @overload list_session_templates(request, options = nil) - # Pass arguments to `list_session_templates` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_session_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent that owns this collection of session templates. - # @param page_size [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @param page_token [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the session templates to return in the response. - # Filters are case sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new - # - # # Call the list_session_templates method. - # result = client.list_session_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. - # p item - # end - # - def list_session_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_session_templates.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_session_templates.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_session_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.call_rpc :list_session_templates, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @session_template_controller_stub, :list_session_templates, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a session template. - # - # @overload delete_session_template(request, options = nil) - # Pass arguments to `delete_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_session_template(name: nil) - # Pass arguments to `delete_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session template resource to delete. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new - # - # # Call the delete_session_template method. - # result = client.delete_session_template request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_session_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.call_rpc :delete_session_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionTemplateController API. - # - # This class represents the configuration for SessionTemplateController, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session_template to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session_template.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session_template.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the SessionTemplateController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session_template - ## - # RPC-specific configuration for `update_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session_template - ## - # RPC-specific configuration for `get_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session_template - ## - # RPC-specific configuration for `list_session_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_session_templates - ## - # RPC-specific configuration for `delete_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session_template - - # @private - def initialize parent_rpcs = nil - create_session_template_config = parent_rpcs.create_session_template if parent_rpcs.respond_to? :create_session_template - @create_session_template = ::Gapic::Config::Method.new create_session_template_config - update_session_template_config = parent_rpcs.update_session_template if parent_rpcs.respond_to? :update_session_template - @update_session_template = ::Gapic::Config::Method.new update_session_template_config - get_session_template_config = parent_rpcs.get_session_template if parent_rpcs.respond_to? :get_session_template - @get_session_template = ::Gapic::Config::Method.new get_session_template_config - list_session_templates_config = parent_rpcs.list_session_templates if parent_rpcs.respond_to? :list_session_templates - @list_session_templates = ::Gapic::Config::Method.new list_session_templates_config - delete_session_template_config = parent_rpcs.delete_session_template if parent_rpcs.respond_to? :delete_session_template - @delete_session_template = ::Gapic::Config::Method.new delete_session_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb deleted file mode 100644 index 30582ff19dbf..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - # Credentials for the SessionTemplateController API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb deleted file mode 100644 index e88c9536f34f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/paths.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - # Path helper methods for the SessionTemplateController API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/services/#{service}" - end - - ## - # Create a fully-qualified SessionTemplate resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sessionTemplates/{template}` - # - # @param project [String] - # @param location [String] - # @param template [String] - # - # @return [::String] - def session_template_path project:, location:, template: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sessionTemplates/#{template}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb deleted file mode 100644 index 8688762d4fbb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/session_template_controller/credentials" -require "google/cloud/dataproc/v1/session_template_controller/paths" -require "google/cloud/dataproc/v1/session_template_controller/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The SessionTemplateController provides methods to manage session templates. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/session_template_controller/rest" - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - module SessionTemplateController - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/session_template_controller/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb deleted file mode 100644 index aa51672f9e46..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/client.rb +++ /dev/null @@ -1,777 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/session_templates_pb" -require "google/cloud/dataproc/v1/session_template_controller/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - module Rest - ## - # REST client for the SessionTemplateController service. - # - # The SessionTemplateController provides methods to manage session templates. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_template_controller_stub - - ## - # Configure the SessionTemplateController Client class. - # - # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionTemplateController clients - # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionTemplateController Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @session_template_controller_stub.universe_domain - end - - ## - # Create a new SessionTemplateController REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionTemplateController client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @session_template_controller_stub = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @session_template_controller_stub.endpoint - config.universe_domain = @session_template_controller_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Create a session template synchronously. - # - # @overload create_session_template(request, options = nil) - # Pass arguments to `create_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_session_template(parent: nil, session_template: nil) - # Pass arguments to `create_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this session template will be created. - # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] - # Required. The session template to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new - # - # # Call the create_session_template method. - # result = client.create_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def create_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_session_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.create_session_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the session template synchronously. - # - # @overload update_session_template(request, options = nil) - # Pass arguments to `update_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_session_template(session_template: nil) - # Pass arguments to `update_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param session_template [::Google::Cloud::Dataproc::V1::SessionTemplate, ::Hash] - # Required. The updated session template. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new - # - # # Call the update_session_template method. - # result = client.update_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def update_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_session_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.update_session_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the resource representation for a session template. - # - # @overload get_session_template(request, options = nil) - # Pass arguments to `get_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_session_template(name: nil) - # Pass arguments to `get_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session template to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new - # - # # Call the get_session_template method. - # result = client.get_session_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - # p result - # - def get_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_session_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.get_session_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists session templates. - # - # @overload list_session_templates(request, options = nil) - # Pass arguments to `list_session_templates` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_session_templates(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_session_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent that owns this collection of session templates. - # @param page_size [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @param page_token [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @param filter [::String] - # Optional. A filter for the session templates to return in the response. - # Filters are case sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::SessionTemplate>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new - # - # # Call the list_session_templates method. - # result = client.list_session_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. - # p item - # end - # - def list_session_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_session_templates.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_session_templates.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_session_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.list_session_templates request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @session_template_controller_stub, :list_session_templates, "session_templates", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a session template. - # - # @overload delete_session_template(request, options = nil) - # Pass arguments to `delete_session_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_session_template(name: nil) - # Pass arguments to `delete_session_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the session template resource to delete. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new - # - # # Call the delete_session_template method. - # result = client.delete_session_template request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_session_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_session_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_session_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_template_controller_stub.delete_session_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the SessionTemplateController REST API. - # - # This class represents the configuration for SessionTemplateController REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_session_template to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_session_template.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_session_template.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the SessionTemplateController API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session_template - ## - # RPC-specific configuration for `update_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session_template - ## - # RPC-specific configuration for `get_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session_template - ## - # RPC-specific configuration for `list_session_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_session_templates - ## - # RPC-specific configuration for `delete_session_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session_template - - # @private - def initialize parent_rpcs = nil - create_session_template_config = parent_rpcs.create_session_template if parent_rpcs.respond_to? :create_session_template - @create_session_template = ::Gapic::Config::Method.new create_session_template_config - update_session_template_config = parent_rpcs.update_session_template if parent_rpcs.respond_to? :update_session_template - @update_session_template = ::Gapic::Config::Method.new update_session_template_config - get_session_template_config = parent_rpcs.get_session_template if parent_rpcs.respond_to? :get_session_template - @get_session_template = ::Gapic::Config::Method.new get_session_template_config - list_session_templates_config = parent_rpcs.list_session_templates if parent_rpcs.respond_to? :list_session_templates - @list_session_templates = ::Gapic::Config::Method.new list_session_templates_config - delete_session_template_config = parent_rpcs.delete_session_template if parent_rpcs.respond_to? :delete_session_template - @delete_session_template = ::Gapic::Config::Method.new delete_session_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb deleted file mode 100644 index 59d3fc963d59..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_template_controller/rest/service_stub.rb +++ /dev/null @@ -1,366 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/session_templates_pb" - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - module Rest - ## - # REST service stub for the SessionTemplateController service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # A result object deserialized from the server's reply - def create_session_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_session_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # A result object deserialized from the server's reply - def update_session_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_session_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::SessionTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # A result object deserialized from the server's reply - def get_session_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_session_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::SessionTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_session_templates REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse] - # A result object deserialized from the server's reply - def list_session_templates request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_session_templates_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_session_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_session_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sessionTemplates", - body: "session_template", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_session_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{session_template.name}", - body: "session_template", - matches: [ - ["session_template.name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_session_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_session_templates REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_session_templates_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sessionTemplates", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_session_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_session_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sessionTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb deleted file mode 100644 index a1ae97853390..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/session_templates.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/sessions_pb' -require 'google/cloud/dataproc/v1/shared_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n0google/cloud/dataproc/v1/session_templates.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/sessions.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x01\n\x1c\x43reateSessionTemplateRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dataproc.googleapis.com/SessionTemplate\x12H\n\x10session_template\x18\x03 \x01(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x02\"h\n\x1cUpdateSessionTemplateRequest\x12H\n\x10session_template\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x02\"Z\n\x19GetSessionTemplateRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\"\xa4\x01\n\x1bListSessionTemplatesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dataproc.googleapis.com/SessionTemplate\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x1cListSessionTemplatesResponse\x12I\n\x11session_templates\x18\x01 \x03(\x0b\x32).google.cloud.dataproc.v1.SessionTemplateB\x03\xe0\x41\x03\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"]\n\x1c\x44\x65leteSessionTemplateRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\"\xb0\x05\n\x0fSessionTemplate\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0fjupyter_session\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JupyterConfigB\x03\xe0\x41\x01H\x00\x12\x14\n\x07\x63reator\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12J\n\x06labels\x18\x06 \x03(\x0b\x32\x35.google.cloud.dataproc.v1.SessionTemplate.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\x08 \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04uuid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:q\xea\x41n\n\'dataproc.googleapis.com/SessionTemplate\x12\x43projects/{project}/locations/{location}/sessionTemplates/{template}B\x10\n\x0esession_config2\xfa\x08\n\x19SessionTemplateController\x12\xe4\x01\n\x15\x43reateSessionTemplate\x12\x36.google.cloud.dataproc.v1.CreateSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"h\xda\x41\x17parent,session_template\x82\xd3\xe4\x93\x02H\"4/v1/{parent=projects/*/locations/*}/sessionTemplates:\x10session_template\x12\xee\x01\n\x15UpdateSessionTemplate\x12\x36.google.cloud.dataproc.v1.UpdateSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"r\xda\x41\x10session_template\x82\xd3\xe4\x93\x02Y2E/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}:\x10session_template\x12\xb9\x01\n\x12GetSessionTemplate\x12\x33.google.cloud.dataproc.v1.GetSessionTemplateRequest\x1a).google.cloud.dataproc.v1.SessionTemplate\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/sessionTemplates/*}\x12\xcc\x01\n\x14ListSessionTemplates\x12\x35.google.cloud.dataproc.v1.ListSessionTemplatesRequest\x1a\x36.google.cloud.dataproc.v1.ListSessionTemplatesResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*}/sessionTemplates\x12\xac\x01\n\x15\x44\x65leteSessionTemplate\x12\x36.google.cloud.dataproc.v1.DeleteSessionTemplateRequest\x1a\x16.google.protobuf.Empty\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/sessionTemplates/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBt\n\x1c\x63om.google.cloud.dataproc.v1B\x15SessionTemplatesProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.dataproc.v1.JupyterConfig", "google/cloud/dataproc/v1/sessions.proto"], - ["google.cloud.dataproc.v1.RuntimeConfig", "google/cloud/dataproc/v1/shared.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - CreateSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateSessionTemplateRequest").msgclass - UpdateSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UpdateSessionTemplateRequest").msgclass - GetSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetSessionTemplateRequest").msgclass - ListSessionTemplatesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionTemplatesRequest").msgclass - ListSessionTemplatesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionTemplatesResponse").msgclass - DeleteSessionTemplateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteSessionTemplateRequest").msgclass - SessionTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SessionTemplate").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb deleted file mode 100644 index 7d4cb14458b9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/session_templates_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/session_templates.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/session_templates_pb' - -module Google - module Cloud - module Dataproc - module V1 - module SessionTemplateController - # The SessionTemplateController provides methods to manage session templates. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.SessionTemplateController' - - # Create a session template synchronously. - rpc :CreateSessionTemplate, ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate - # Updates the session template synchronously. - rpc :UpdateSessionTemplate, ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate - # Gets the resource representation for a session template. - rpc :GetSessionTemplate, ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, ::Google::Cloud::Dataproc::V1::SessionTemplate - # Lists session templates. - rpc :ListSessionTemplates, ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse - # Deletes a session template. - rpc :DeleteSessionTemplate, ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb deleted file mode 100644 index e6f139356d0e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/sessions.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/shared_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\'google/cloud/dataproc/v1/sessions.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dataproc/v1/shared.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xba\x01\n\x14\x43reateSessionRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64\x61taproc.googleapis.com/Session\x12\x37\n\x07session\x18\x02 \x01(\x0b\x32!.google.cloud.dataproc.v1.SessionB\x03\xe0\x41\x02\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"J\n\x11GetSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\"\x94\x01\n\x13ListSessionsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64\x61taproc.googleapis.com/Session\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"i\n\x14ListSessionsResponse\x12\x38\n\x08sessions\x18\x01 \x03(\x0b\x32!.google.cloud.dataproc.v1.SessionB\x03\xe0\x41\x03\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"i\n\x17TerminateSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteSessionRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64\x61taproc.googleapis.com/Session\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd3\t\n\x07Session\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04uuid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x0fjupyter_session\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.JupyterConfigB\x03\xe0\x41\x01H\x00\x12@\n\x0cruntime_info\x18\x06 \x01(\x0b\x32%.google.cloud.dataproc.v1.RuntimeInfoB\x03\xe0\x41\x03\x12;\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.dataproc.v1.Session.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x14\n\x07\x63reator\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x06labels\x18\x0b \x03(\x0b\x32-.google.cloud.dataproc.v1.Session.LabelsEntryB\x03\xe0\x41\x01\x12\x44\n\x0eruntime_config\x18\x0c \x01(\x0b\x32\'.google.cloud.dataproc.v1.RuntimeConfigB\x03\xe0\x41\x01\x12L\n\x12\x65nvironment_config\x18\r \x01(\x0b\x32+.google.cloud.dataproc.v1.EnvironmentConfigB\x03\xe0\x41\x01\x12\x11\n\x04user\x18\x0e \x01(\tB\x03\xe0\x41\x01\x12Q\n\rstate_history\x18\x0f \x03(\x0b\x32\x35.google.cloud.dataproc.v1.Session.SessionStateHistoryB\x03\xe0\x41\x03\x12I\n\x10session_template\x18\x10 \x01(\tB/\xe0\x41\x01\xfa\x41)\n\'dataproc.googleapis.com/SessionTemplate\x1a\xa9\x01\n\x13SessionStateHistory\x12;\n\x05state\x18\x01 \x01(\x0e\x32\'.google.cloud.dataproc.v1.Session.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x39\n\x10state_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0f\n\x0bTERMINATING\x10\x03\x12\x0e\n\nTERMINATED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:`\xea\x41]\n\x1f\x64\x61taproc.googleapis.com/Session\x12:projects/{project}/locations/{location}/sessions/{session}B\x10\n\x0esession_config\"\xa8\x01\n\rJupyterConfig\x12\x43\n\x06kernel\x18\x01 \x01(\x0e\x32..google.cloud.dataproc.v1.JupyterConfig.KernelB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\"7\n\x06Kernel\x12\x16\n\x12KERNEL_UNSPECIFIED\x10\x00\x12\n\n\x06PYTHON\x10\x01\x12\t\n\x05SCALA\x10\x02\x32\xf5\x08\n\x11SessionController\x12\xf9\x01\n\rCreateSession\x12..google.cloud.dataproc.v1.CreateSessionRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x19parent,session,session_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/sessions:\x07session\x12\x99\x01\n\nGetSession\x12+.google.cloud.dataproc.v1.GetSessionRequest\x1a!.google.cloud.dataproc.v1.Session\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/sessions/*}\x12\xac\x01\n\x0cListSessions\x12-.google.cloud.dataproc.v1.ListSessionsRequest\x1a..google.cloud.dataproc.v1.ListSessionsResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/sessions\x12\xee\x01\n\x10TerminateSession\x12\x31.google.cloud.dataproc.v1.TerminateSessionRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;\"6/v1/{name=projects/*/locations/*/sessions/*}:terminate:\x01*\x12\xda\x01\n\rDeleteSession\x12..google.cloud.dataproc.v1.DeleteSessionRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41<\n\x07Session\x12\x31google.cloud.dataproc.v1.SessionOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/sessions/*}\x1aK\xca\x41\x17\x64\x61taproc.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBl\n\x1c\x63om.google.cloud.dataproc.v1B\rSessionsProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpbb\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.dataproc.v1.RuntimeInfo", "google/cloud/dataproc/v1/shared.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - CreateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.CreateSessionRequest").msgclass - GetSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GetSessionRequest").msgclass - ListSessionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionsRequest").msgclass - ListSessionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ListSessionsResponse").msgclass - TerminateSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.TerminateSessionRequest").msgclass - DeleteSessionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.DeleteSessionRequest").msgclass - Session = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session").msgclass - Session::SessionStateHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session.SessionStateHistory").msgclass - Session::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Session.State").enummodule - JupyterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JupyterConfig").msgclass - JupyterConfig::Kernel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.JupyterConfig.Kernel").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb deleted file mode 100644 index 7d120abf7862..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/sessions_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dataproc/v1/sessions.proto for package 'google.cloud.dataproc.v1' -# Original file comments: -# Copyright 2024 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 -# -# http://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. -# - -require 'grpc' -require 'google/cloud/dataproc/v1/sessions_pb' - -module Google - module Cloud - module Dataproc - module V1 - module SessionController - # The `SessionController` provides methods to manage interactive sessions. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dataproc.v1.SessionController' - - # Create an interactive session asynchronously. - rpc :CreateSession, ::Google::Cloud::Dataproc::V1::CreateSessionRequest, ::Google::Longrunning::Operation - # Gets the resource representation for an interactive session. - rpc :GetSession, ::Google::Cloud::Dataproc::V1::GetSessionRequest, ::Google::Cloud::Dataproc::V1::Session - # Lists interactive sessions. - rpc :ListSessions, ::Google::Cloud::Dataproc::V1::ListSessionsRequest, ::Google::Cloud::Dataproc::V1::ListSessionsResponse - # Terminates the interactive session. - rpc :TerminateSession, ::Google::Cloud::Dataproc::V1::TerminateSessionRequest, ::Google::Longrunning::Operation - # Deletes the interactive session resource. If the session is not in terminal - # state, it is terminated, and then deleted. - rpc :DeleteSession, ::Google::Cloud::Dataproc::V1::DeleteSessionRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb deleted file mode 100644 index 57b16e879b03..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/shared_pb.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/shared.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/dataproc/v1/shared.proto\x12\x18google.cloud.dataproc.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf5\x02\n\rRuntimeConfig\x12\x14\n\x07version\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x63ontainer_image\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12P\n\nproperties\x18\x03 \x03(\x0b\x32\x37.google.cloud.dataproc.v1.RuntimeConfig.PropertiesEntryB\x03\xe0\x41\x01\x12J\n\x11repository_config\x18\x05 \x01(\x0b\x32*.google.cloud.dataproc.v1.RepositoryConfigB\x03\xe0\x41\x01\x12J\n\x11\x61utotuning_config\x18\x06 \x01(\x0b\x32*.google.cloud.dataproc.v1.AutotuningConfigB\x03\xe0\x41\x01\x12\x13\n\x06\x63ohort\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xab\x01\n\x11\x45nvironmentConfig\x12H\n\x10\x65xecution_config\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.ExecutionConfigB\x03\xe0\x41\x01\x12L\n\x12peripherals_config\x18\x02 \x01(\x0b\x32+.google.cloud.dataproc.v1.PeripheralsConfigB\x03\xe0\x41\x01\"\xa2\x02\n\x0f\x45xecutionConfig\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\x0bnetwork_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x1d\n\x0esubnetwork_uri\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x19\n\x0cnetwork_tags\x18\x06 \x03(\tB\x03\xe0\x41\x01\x12\x14\n\x07kms_key\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x30\n\x08idle_ttl\x18\x08 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12+\n\x03ttl\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x1b\n\x0estaging_bucket\x18\n \x01(\tB\x03\xe0\x41\x01\x42\t\n\x07network\"9\n\x18SparkHistoryServerConfig\x12\x1d\n\x10\x64\x61taproc_cluster\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xb6\x01\n\x11PeripheralsConfig\x12\x43\n\x11metastore_service\x18\x01 \x01(\tB(\xe0\x41\x01\xfa\x41\"\n metastore.googleapis.com/Service\x12\\\n\x1bspark_history_server_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.SparkHistoryServerConfigB\x03\xe0\x41\x01\"\xd7\x02\n\x0bRuntimeInfo\x12L\n\tendpoints\x18\x01 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.RuntimeInfo.EndpointsEntryB\x03\xe0\x41\x03\x12\x17\n\noutput_uri\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15\x64iagnostic_output_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x46\n\x11\x61pproximate_usage\x18\x06 \x01(\x0b\x32&.google.cloud.dataproc.v1.UsageMetricsB\x03\xe0\x41\x03\x12\x43\n\rcurrent_usage\x18\x07 \x01(\x0b\x32\'.google.cloud.dataproc.v1.UsageSnapshotB\x03\xe0\x41\x03\x1a\x30\n\x0e\x45ndpointsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9e\x01\n\x0cUsageMetrics\x12\x1e\n\x11milli_dcu_seconds\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\'\n\x1ashuffle_storage_gb_seconds\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12&\n\x19milli_accelerator_seconds\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x88\x02\n\rUsageSnapshot\x12\x16\n\tmilli_dcu\x18\x01 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1f\n\x12shuffle_storage_gb\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11milli_dcu_premium\x18\x04 \x01(\x03\x42\x03\xe0\x41\x01\x12\'\n\x1ashuffle_storage_gb_premium\x18\x05 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1e\n\x11milli_accelerator\x18\x06 \x01(\x03\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x61\x63\x63\x65lerator_type\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x36\n\rsnapshot_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\xa4\x01\n\x10GkeClusterConfig\x12\x44\n\x12gke_cluster_target\x18\x02 \x01(\tB(\xe0\x41\x01\xfa\x41\"\n container.googleapis.com/Cluster\x12J\n\x10node_pool_target\x18\x03 \x03(\x0b\x32+.google.cloud.dataproc.v1.GkeNodePoolTargetB\x03\xe0\x41\x01\"\xf2\x01\n\x17KubernetesClusterConfig\x12!\n\x14kubernetes_namespace\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12M\n\x12gke_cluster_config\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.GkeClusterConfigB\x03\xe0\x41\x02H\x00\x12[\n\x1akubernetes_software_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dataproc.v1.KubernetesSoftwareConfigB\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\"\xc3\x02\n\x18KubernetesSoftwareConfig\x12\x63\n\x11\x63omponent_version\x18\x01 \x03(\x0b\x32H.google.cloud.dataproc.v1.KubernetesSoftwareConfig.ComponentVersionEntry\x12V\n\nproperties\x18\x02 \x03(\x0b\x32\x42.google.cloud.dataproc.v1.KubernetesSoftwareConfig.PropertiesEntry\x1a\x37\n\x15\x43omponentVersionEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x9e\x02\n\x11GkeNodePoolTarget\x12\x16\n\tnode_pool\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x05roles\x18\x02 \x03(\x0e\x32\x30.google.cloud.dataproc.v1.GkeNodePoolTarget.RoleB\x03\xe0\x41\x02\x12J\n\x10node_pool_config\x18\x03 \x01(\x0b\x32+.google.cloud.dataproc.v1.GkeNodePoolConfigB\x03\xe0\x41\x04\"_\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0e\n\nCONTROLLER\x10\x02\x12\x10\n\x0cSPARK_DRIVER\x10\x03\x12\x12\n\x0eSPARK_EXECUTOR\x10\x04\"\xbc\x05\n\x11GkeNodePoolConfig\x12N\n\x06\x63onfig\x18\x02 \x01(\x0b\x32\x39.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfigB\x03\xe0\x41\x01\x12\x16\n\tlocations\x18\r \x03(\tB\x03\xe0\x41\x01\x12\x62\n\x0b\x61utoscaling\x18\x04 \x01(\x0b\x32H.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfigB\x03\xe0\x41\x01\x1a\x99\x02\n\rGkeNodeConfig\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0flocal_ssd_count\x18\x07 \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0bpreemptible\x18\n \x01(\x08\x42\x03\xe0\x41\x01\x12\x63\n\x0c\x61\x63\x63\x65lerators\x18\x0b \x03(\x0b\x32H.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfigB\x03\xe0\x41\x01\x12\x1d\n\x10min_cpu_platform\x18\r \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_kms_key\x18\x17 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04spot\x18 \x01(\x08\x42\x03\xe0\x41\x01\x1ao\n\x1cGkeNodePoolAcceleratorConfig\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x01 \x01(\x03\x12\x18\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\t\x12\x1a\n\x12gpu_partition_size\x18\x03 \x01(\t\x1aN\n\x1cGkeNodePoolAutoscalingConfig\x12\x16\n\x0emin_node_count\x18\x02 \x01(\x05\x12\x16\n\x0emax_node_count\x18\x03 \x01(\x05\"\xb7\x01\n\x10\x41utotuningConfig\x12K\n\tscenarios\x18\x02 \x03(\x0e\x32\x33.google.cloud.dataproc.v1.AutotuningConfig.ScenarioB\x03\xe0\x41\x01\"V\n\x08Scenario\x12\x18\n\x14SCENARIO_UNSPECIFIED\x10\x00\x12\x0b\n\x07SCALING\x10\x02\x12\x17\n\x13\x42ROADCAST_HASH_JOIN\x10\x03\x12\n\n\x06MEMORY\x10\x04\"g\n\x10RepositoryConfig\x12S\n\x16pypi_repository_config\x18\x01 \x01(\x0b\x32..google.cloud.dataproc.v1.PyPiRepositoryConfigB\x03\xe0\x41\x01\"4\n\x14PyPiRepositoryConfig\x12\x1c\n\x0fpypi_repository\x18\x01 \x01(\tB\x03\xe0\x41\x01*\xd4\x01\n\tComponent\x12\x19\n\x15\x43OMPONENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41NACONDA\x10\x05\x12\n\n\x06\x44OCKER\x10\r\x12\t\n\x05\x44RUID\x10\t\x12\t\n\x05\x46LINK\x10\x0e\x12\t\n\x05HBASE\x10\x0b\x12\x10\n\x0cHIVE_WEBHCAT\x10\x03\x12\x08\n\x04HUDI\x10\x12\x12\x0b\n\x07JUPYTER\x10\x01\x12\n\n\x06PRESTO\x10\x06\x12\t\n\x05TRINO\x10\x11\x12\n\n\x06RANGER\x10\x0c\x12\x08\n\x04SOLR\x10\n\x12\x0c\n\x08ZEPPELIN\x10\x04\x12\r\n\tZOOKEEPER\x10\x08*J\n\rFailureAction\x12\x1e\n\x1a\x46\x41ILURE_ACTION_UNSPECIFIED\x10\x00\x12\r\n\tNO_ACTION\x10\x01\x12\n\n\x06\x44\x45LETE\x10\x02\x42\xac\x02\n\x1c\x63om.google.cloud.dataproc.v1B\x0bSharedProtoP\x01Z;cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb\xea\x41^\n container.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}\xea\x41^\n metastore.googleapis.com/Service\x12:projects/{project}/locations/{location}/services/{service}b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Dataproc - module V1 - RuntimeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RuntimeConfig").msgclass - EnvironmentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.EnvironmentConfig").msgclass - ExecutionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.ExecutionConfig").msgclass - SparkHistoryServerConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.SparkHistoryServerConfig").msgclass - PeripheralsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PeripheralsConfig").msgclass - RuntimeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RuntimeInfo").msgclass - UsageMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UsageMetrics").msgclass - UsageSnapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.UsageSnapshot").msgclass - GkeClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeClusterConfig").msgclass - KubernetesClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KubernetesClusterConfig").msgclass - KubernetesSoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.KubernetesSoftwareConfig").msgclass - GkeNodePoolTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolTarget").msgclass - GkeNodePoolTarget::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolTarget.Role").enummodule - GkeNodePoolConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig").msgclass - GkeNodePoolConfig::GkeNodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig").msgclass - GkeNodePoolConfig::GkeNodePoolAcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig").msgclass - GkeNodePoolConfig::GkeNodePoolAutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig").msgclass - AutotuningConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutotuningConfig").msgclass - AutotuningConfig::Scenario = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.AutotuningConfig.Scenario").enummodule - RepositoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.RepositoryConfig").msgclass - PyPiRepositoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.PyPiRepositoryConfig").msgclass - Component = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.Component").enummodule - FailureAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1.FailureAction").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb deleted file mode 100644 index 8e3ed3953392..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb deleted file mode 100644 index 602d10ccaf8d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" - -require "google/cloud/dataproc/v1/workflow_template_service/credentials" -require "google/cloud/dataproc/v1/workflow_template_service/paths" -require "google/cloud/dataproc/v1/workflow_template_service/operations" -require "google/cloud/dataproc/v1/workflow_template_service/client" -require "google/cloud/dataproc/v1/workflow_template_service/rest" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The API interface for managing Workflow Templates in the - # Dataproc API. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dataproc/v1/workflow_template_service" - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dataproc/v1/workflow_template_service/rest" - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - module WorkflowTemplateService - end - end - end - end -end - -helper_path = ::File.join __dir__, "workflow_template_service", "helpers.rb" -require "google/cloud/dataproc/v1/workflow_template_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb deleted file mode 100644 index 4ec2e557e116..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +++ /dev/null @@ -1,1220 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/workflow_templates_pb" -require "google/iam/v1" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - ## - # Client for the WorkflowTemplateService service. - # - # The API interface for managing Workflow Templates in the - # Dataproc API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflow_template_service_stub - - ## - # Configure the WorkflowTemplateService Client class. - # - # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WorkflowTemplateService clients - # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_workflow_template.timeout = 600.0 - default_config.rpcs.create_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_workflow_template.timeout = 600.0 - default_config.rpcs.get_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.instantiate_workflow_template.timeout = 600.0 - default_config.rpcs.instantiate_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.instantiate_inline_workflow_template.timeout = 600.0 - default_config.rpcs.instantiate_inline_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_workflow_template.timeout = 600.0 - default_config.rpcs.update_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workflow_templates.timeout = 600.0 - default_config.rpcs.list_workflow_templates.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.delete_workflow_template.timeout = 600.0 - default_config.rpcs.delete_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WorkflowTemplateService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @workflow_template_service_stub.universe_domain - end - - ## - # Create a new WorkflowTemplateService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WorkflowTemplateService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/dataproc/v1/workflow_templates_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @workflow_template_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @workflow_template_service_stub.endpoint - config.universe_domain = @workflow_template_service_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates new workflow template. - # - # @overload create_workflow_template(request, options = nil) - # Pass arguments to `create_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_workflow_template(parent: nil, template: nil) - # Pass arguments to `create_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.create`, the resource name of the - # region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.create`, the resource name of - # the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The Dataproc workflow template to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new - # - # # Call the create_workflow_template method. - # result = client.create_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def create_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :create_workflow_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the latest workflow template. - # - # Can retrieve previously instantiated template by specifying optional - # version parameter. - # - # @overload get_workflow_template(request, options = nil) - # Pass arguments to `get_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_workflow_template(name: nil, version: nil) - # Pass arguments to `get_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to retrieve. Only previously - # instantiated versions can be retrieved. - # - # If unspecified, retrieves the current version. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new - # - # # Call the get_workflow_template method. - # result = client.get_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def get_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :get_workflow_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Instantiates a template and begins execution. - # - # The returned Operation can be used to track execution of - # workflow by polling - # operations.get. - # The Operation will complete when entire workflow is finished. - # - # The running workflow can be aborted via - # operations.cancel. - # This will cause any inflight jobs to be cancelled and workflow-owned - # clusters to be deleted. - # - # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - # Also see [Using - # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - # - # On successful completion, - # {::Google::Longrunning::Operation#response Operation.response} will be - # {::Google::Protobuf::Empty Empty}. - # - # @overload instantiate_workflow_template(request, options = nil) - # Pass arguments to `instantiate_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload instantiate_workflow_template(name: nil, version: nil, request_id: nil, parameters: nil) - # Pass arguments to `instantiate_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to instantiate. If specified, - # the workflow will be instantiated only if the current version of - # the workflow template has the supplied version. - # - # This option cannot be used to instantiate a previous version of - # workflow template. - # @param request_id [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param parameters [::Hash{::String => ::String}] - # Optional. Map from parameter names to values that should be used for those - # parameters. Values may not exceed 1000 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new - # - # # Call the instantiate_workflow_template method. - # result = client.instantiate_workflow_template request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def instantiate_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.instantiate_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.instantiate_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.instantiate_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :instantiate_workflow_template, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Instantiates a template and begins execution. - # - # This method is equivalent to executing the sequence - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template CreateWorkflowTemplate}, - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template InstantiateWorkflowTemplate}, - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template DeleteWorkflowTemplate}. - # - # The returned Operation can be used to track execution of - # workflow by polling - # operations.get. - # The Operation will complete when entire workflow is finished. - # - # The running workflow can be aborted via - # operations.cancel. - # This will cause any inflight jobs to be cancelled and workflow-owned - # clusters to be deleted. - # - # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - # Also see [Using - # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - # - # On successful completion, - # {::Google::Longrunning::Operation#response Operation.response} will be - # {::Google::Protobuf::Empty Empty}. - # - # @overload instantiate_inline_workflow_template(request, options = nil) - # Pass arguments to `instantiate_inline_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload instantiate_inline_workflow_template(parent: nil, template: nil, request_id: nil) - # Pass arguments to `instantiate_inline_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,instantiateinline`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.instantiateinline`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The workflow template to instantiate. - # @param request_id [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new - # - # # Call the instantiate_inline_workflow_template method. - # result = client.instantiate_inline_workflow_template request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def instantiate_inline_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.instantiate_inline_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.instantiate_inline_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.instantiate_inline_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :instantiate_inline_workflow_template, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates (replaces) workflow template. The updated template - # must contain version that matches the current server version. - # - # @overload update_workflow_template(request, options = nil) - # Pass arguments to `update_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_workflow_template(template: nil) - # Pass arguments to `update_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The updated workflow template. - # - # The `template.version` field must match the current version. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new - # - # # Call the update_workflow_template method. - # result = client.update_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def update_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.template&.name - header_params["template.name"] = request.template.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :update_workflow_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists workflows that match the specified filter in the request. - # - # @overload list_workflow_templates(request, options = nil) - # Pass arguments to `list_workflow_templates` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_workflow_templates(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workflow_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,list`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.list`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in each response. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new - # - # # Call the list_workflow_templates method. - # result = client.list_workflow_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p item - # end - # - def list_workflow_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_workflow_templates.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_workflow_templates.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workflow_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :list_workflow_templates, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workflow_template_service_stub, :list_workflow_templates, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a workflow template. It does not cancel in-progress workflows. - # - # @overload delete_workflow_template(request, options = nil) - # Pass arguments to `delete_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_workflow_template(name: nil, version: nil) - # Pass arguments to `delete_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.delete`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to delete. If specified, - # will only delete the template if the current server version matches - # specified version. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new - # - # # Call the delete_workflow_template method. - # result = client.delete_workflow_template request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_workflow_template.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.call_rpc :delete_workflow_template, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the WorkflowTemplateService API. - # - # This class represents the configuration for WorkflowTemplateService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_workflow_template to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_workflow_template.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_workflow_template.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the WorkflowTemplateService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow_template - ## - # RPC-specific configuration for `get_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow_template - ## - # RPC-specific configuration for `instantiate_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :instantiate_workflow_template - ## - # RPC-specific configuration for `instantiate_inline_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :instantiate_inline_workflow_template - ## - # RPC-specific configuration for `update_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow_template - ## - # RPC-specific configuration for `list_workflow_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflow_templates - ## - # RPC-specific configuration for `delete_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow_template - - # @private - def initialize parent_rpcs = nil - create_workflow_template_config = parent_rpcs.create_workflow_template if parent_rpcs.respond_to? :create_workflow_template - @create_workflow_template = ::Gapic::Config::Method.new create_workflow_template_config - get_workflow_template_config = parent_rpcs.get_workflow_template if parent_rpcs.respond_to? :get_workflow_template - @get_workflow_template = ::Gapic::Config::Method.new get_workflow_template_config - instantiate_workflow_template_config = parent_rpcs.instantiate_workflow_template if parent_rpcs.respond_to? :instantiate_workflow_template - @instantiate_workflow_template = ::Gapic::Config::Method.new instantiate_workflow_template_config - instantiate_inline_workflow_template_config = parent_rpcs.instantiate_inline_workflow_template if parent_rpcs.respond_to? :instantiate_inline_workflow_template - @instantiate_inline_workflow_template = ::Gapic::Config::Method.new instantiate_inline_workflow_template_config - update_workflow_template_config = parent_rpcs.update_workflow_template if parent_rpcs.respond_to? :update_workflow_template - @update_workflow_template = ::Gapic::Config::Method.new update_workflow_template_config - list_workflow_templates_config = parent_rpcs.list_workflow_templates if parent_rpcs.respond_to? :list_workflow_templates - @list_workflow_templates = ::Gapic::Config::Method.new list_workflow_templates_config - delete_workflow_template_config = parent_rpcs.delete_workflow_template if parent_rpcs.respond_to? :delete_workflow_template - @delete_workflow_template = ::Gapic::Config::Method.new delete_workflow_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb deleted file mode 100644 index 986bbe754467..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/credentials.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - # Credentials for the WorkflowTemplateService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "DATAPROC_CREDENTIALS", - "DATAPROC_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DATAPROC_CREDENTIALS_JSON", - "DATAPROC_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb deleted file mode 100644 index f6c27c1f967a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the WorkflowTemplateService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the WorkflowTemplateService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb deleted file mode 100644 index efcbebb42259..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - # Path helper methods for the WorkflowTemplateService API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified NodeGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}` - # - # @param project [String] - # @param region [String] - # @param cluster [String] - # @param node_group [String] - # - # @return [::String] - def node_group_path project:, region:, cluster:, node_group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}" - end - - ## - # Create a fully-qualified Region resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}` - # - # @param project [String] - # @param region [String] - # - # @return [::String] - def region_path project:, region: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/regions/#{region}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/services/#{service}" - end - - ## - # Create a fully-qualified WorkflowTemplate resource string. - # - # @overload workflow_template_path(project:, region:, workflow_template:) - # The resource will be in the following format: - # - # `projects/{project}/regions/{region}/workflowTemplates/{workflow_template}` - # - # @param project [String] - # @param region [String] - # @param workflow_template [String] - # - # @overload workflow_template_path(project:, location:, workflow_template:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflowTemplates/{workflow_template}` - # - # @param project [String] - # @param location [String] - # @param workflow_template [String] - # - # @return [::String] - def workflow_template_path **args - resources = { - "project:region:workflow_template" => (proc do |project:, region:, workflow_template:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/" - - "projects/#{project}/regions/#{region}/workflowTemplates/#{workflow_template}" - end), - "location:project:workflow_template" => (proc do |project:, location:, workflow_template:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflowTemplates/#{workflow_template}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb deleted file mode 100644 index 0bd0d601c6a5..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dataproc/v1/version" -require "google/cloud/dataproc/v1/bindings_override" - -require "google/cloud/dataproc/v1/workflow_template_service/credentials" -require "google/cloud/dataproc/v1/workflow_template_service/paths" -require "google/cloud/dataproc/v1/workflow_template_service/rest/operations" -require "google/cloud/dataproc/v1/workflow_template_service/rest/client" - -module Google - module Cloud - module Dataproc - module V1 - ## - # The API interface for managing Workflow Templates in the - # Dataproc API. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dataproc/v1/workflow_template_service/rest" - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - module WorkflowTemplateService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dataproc/v1/workflow_template_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb deleted file mode 100644 index fbbea732e848..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/client.rb +++ /dev/null @@ -1,1153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/dataproc/v1/workflow_templates_pb" -require "google/cloud/dataproc/v1/workflow_template_service/rest/service_stub" -require "google/iam/v1/rest" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - module Rest - ## - # REST client for the WorkflowTemplateService service. - # - # The API interface for managing Workflow Templates in the - # Dataproc API. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflow_template_service_stub - - ## - # Configure the WorkflowTemplateService Client class. - # - # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WorkflowTemplateService clients - # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dataproc", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_workflow_template.timeout = 600.0 - default_config.rpcs.create_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_workflow_template.timeout = 600.0 - default_config.rpcs.get_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.instantiate_workflow_template.timeout = 600.0 - default_config.rpcs.instantiate_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.instantiate_inline_workflow_template.timeout = 600.0 - default_config.rpcs.instantiate_inline_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_workflow_template.timeout = 600.0 - default_config.rpcs.update_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workflow_templates.timeout = 600.0 - default_config.rpcs.list_workflow_templates.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 13, 14] - } - - default_config.rpcs.delete_workflow_template.timeout = 600.0 - default_config.rpcs.delete_workflow_template.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WorkflowTemplateService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @workflow_template_service_stub.universe_domain - end - - ## - # Create a new WorkflowTemplateService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WorkflowTemplateService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @workflow_template_service_stub = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @workflow_template_service_stub.endpoint - config.universe_domain = @workflow_template_service_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the IAMPolicy. - # - # @return [Google::Iam::V1::IAMPolicy::Rest::Client] - # - attr_reader :iam_policy_client - - # Service calls - - ## - # Creates new workflow template. - # - # @overload create_workflow_template(request, options = nil) - # Pass arguments to `create_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_workflow_template(parent: nil, template: nil) - # Pass arguments to `create_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.create`, the resource name of the - # region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.create`, the resource name of - # the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The Dataproc workflow template to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new - # - # # Call the create_workflow_template method. - # result = client.create_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def create_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.create_workflow_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves the latest workflow template. - # - # Can retrieve previously instantiated template by specifying optional - # version parameter. - # - # @overload get_workflow_template(request, options = nil) - # Pass arguments to `get_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_workflow_template(name: nil, version: nil) - # Pass arguments to `get_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to retrieve. Only previously - # instantiated versions can be retrieved. - # - # If unspecified, retrieves the current version. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new - # - # # Call the get_workflow_template method. - # result = client.get_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def get_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.get_workflow_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Instantiates a template and begins execution. - # - # The returned Operation can be used to track execution of - # workflow by polling - # operations.get. - # The Operation will complete when entire workflow is finished. - # - # The running workflow can be aborted via - # operations.cancel. - # This will cause any inflight jobs to be cancelled and workflow-owned - # clusters to be deleted. - # - # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - # Also see [Using - # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - # - # On successful completion, - # {::Google::Longrunning::Operation#response Operation.response} will be - # {::Google::Protobuf::Empty Empty}. - # - # @overload instantiate_workflow_template(request, options = nil) - # Pass arguments to `instantiate_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload instantiate_workflow_template(name: nil, version: nil, request_id: nil, parameters: nil) - # Pass arguments to `instantiate_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to instantiate. If specified, - # the workflow will be instantiated only if the current version of - # the workflow template has the supplied version. - # - # This option cannot be used to instantiate a previous version of - # workflow template. - # @param request_id [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @param parameters [::Hash{::String => ::String}] - # Optional. Map from parameter names to values that should be used for those - # parameters. Values may not exceed 1000 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new - # - # # Call the instantiate_workflow_template method. - # result = client.instantiate_workflow_template request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def instantiate_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.instantiate_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.instantiate_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.instantiate_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.instantiate_workflow_template request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Instantiates a template and begins execution. - # - # This method is equivalent to executing the sequence - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#create_workflow_template CreateWorkflowTemplate}, - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#instantiate_workflow_template InstantiateWorkflowTemplate}, - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client#delete_workflow_template DeleteWorkflowTemplate}. - # - # The returned Operation can be used to track execution of - # workflow by polling - # operations.get. - # The Operation will complete when entire workflow is finished. - # - # The running workflow can be aborted via - # operations.cancel. - # This will cause any inflight jobs to be cancelled and workflow-owned - # clusters to be deleted. - # - # The {::Google::Longrunning::Operation#metadata Operation.metadata} will be - # [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - # Also see [Using - # WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - # - # On successful completion, - # {::Google::Longrunning::Operation#response Operation.response} will be - # {::Google::Protobuf::Empty Empty}. - # - # @overload instantiate_inline_workflow_template(request, options = nil) - # Pass arguments to `instantiate_inline_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload instantiate_inline_workflow_template(parent: nil, template: nil, request_id: nil) - # Pass arguments to `instantiate_inline_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,instantiateinline`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.instantiateinline`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The workflow template to instantiate. - # @param request_id [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new - # - # # Call the instantiate_inline_workflow_template method. - # result = client.instantiate_inline_workflow_template request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def instantiate_inline_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.instantiate_inline_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.instantiate_inline_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.instantiate_inline_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.instantiate_inline_workflow_template request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates (replaces) workflow template. The updated template - # must contain version that matches the current server version. - # - # @overload update_workflow_template(request, options = nil) - # Pass arguments to `update_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_workflow_template(template: nil) - # Pass arguments to `update_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param template [::Google::Cloud::Dataproc::V1::WorkflowTemplate, ::Hash] - # Required. The updated workflow template. - # - # The `template.version` field must match the current version. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new - # - # # Call the update_workflow_template method. - # result = client.update_workflow_template request - # - # # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p result - # - def update_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.update_workflow_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists workflows that match the specified filter in the request. - # - # @overload list_workflow_templates(request, options = nil) - # Pass arguments to `list_workflow_templates` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_workflow_templates(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workflow_templates` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,list`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.list`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of results to return in each response. - # @param page_token [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new - # - # # Call the list_workflow_templates method. - # result = client.list_workflow_templates request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. - # p item - # end - # - def list_workflow_templates request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_workflow_templates.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_workflow_templates.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workflow_templates.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.list_workflow_templates request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workflow_template_service_stub, :list_workflow_templates, "templates", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a workflow template. It does not cancel in-progress workflows. - # - # @overload delete_workflow_template(request, options = nil) - # Pass arguments to `delete_workflow_template` via a request object, either of type - # {::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_workflow_template(name: nil, version: nil) - # Pass arguments to `delete_workflow_template` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.delete`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @param version [::Integer] - # Optional. The version of workflow template to delete. If specified, - # will only delete the template if the current server version matches - # specified version. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dataproc/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new - # - # # Call the delete_workflow_template method. - # result = client.delete_workflow_template request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_workflow_template request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_workflow_template.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_workflow_template.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workflow_template.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflow_template_service_stub.delete_workflow_template request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the WorkflowTemplateService REST API. - # - # This class represents the configuration for WorkflowTemplateService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_workflow_template to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_workflow_template.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_workflow_template.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the WorkflowTemplateService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow_template - ## - # RPC-specific configuration for `get_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow_template - ## - # RPC-specific configuration for `instantiate_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :instantiate_workflow_template - ## - # RPC-specific configuration for `instantiate_inline_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :instantiate_inline_workflow_template - ## - # RPC-specific configuration for `update_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow_template - ## - # RPC-specific configuration for `list_workflow_templates` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflow_templates - ## - # RPC-specific configuration for `delete_workflow_template` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow_template - - # @private - def initialize parent_rpcs = nil - create_workflow_template_config = parent_rpcs.create_workflow_template if parent_rpcs.respond_to? :create_workflow_template - @create_workflow_template = ::Gapic::Config::Method.new create_workflow_template_config - get_workflow_template_config = parent_rpcs.get_workflow_template if parent_rpcs.respond_to? :get_workflow_template - @get_workflow_template = ::Gapic::Config::Method.new get_workflow_template_config - instantiate_workflow_template_config = parent_rpcs.instantiate_workflow_template if parent_rpcs.respond_to? :instantiate_workflow_template - @instantiate_workflow_template = ::Gapic::Config::Method.new instantiate_workflow_template_config - instantiate_inline_workflow_template_config = parent_rpcs.instantiate_inline_workflow_template if parent_rpcs.respond_to? :instantiate_inline_workflow_template - @instantiate_inline_workflow_template = ::Gapic::Config::Method.new instantiate_inline_workflow_template_config - update_workflow_template_config = parent_rpcs.update_workflow_template if parent_rpcs.respond_to? :update_workflow_template - @update_workflow_template = ::Gapic::Config::Method.new update_workflow_template_config - list_workflow_templates_config = parent_rpcs.list_workflow_templates if parent_rpcs.respond_to? :list_workflow_templates - @list_workflow_templates = ::Gapic::Config::Method.new list_workflow_templates_config - delete_workflow_template_config = parent_rpcs.delete_workflow_template if parent_rpcs.respond_to? :delete_workflow_template - @delete_workflow_template = ::Gapic::Config::Method.new delete_workflow_template_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb deleted file mode 100644 index 0c92606c8862..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/operations.rb +++ /dev/null @@ -1,929 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dataproc.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the WorkflowTemplateService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the WorkflowTemplateService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dataproc::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "dataproc.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb deleted file mode 100644 index 4b2554f319a2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_template_service/rest/service_stub.rb +++ /dev/null @@ -1,539 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/dataproc/v1/workflow_templates_pb" - -module Google - module Cloud - module Dataproc - module V1 - module WorkflowTemplateService - module Rest - ## - # REST service stub for the WorkflowTemplateService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # A result object deserialized from the server's reply - def create_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # A result object deserialized from the server's reply - def get_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the instantiate_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def instantiate_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_instantiate_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the instantiate_inline_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def instantiate_inline_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_instantiate_inline_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the update_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # A result object deserialized from the server's reply - def update_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_workflow_templates REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse] - # A result object deserialized from the server's reply - def list_workflow_templates request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workflow_templates_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_workflow_template request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_template_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workflowTemplates", - body: "template", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workflowTemplates", - body: "template", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the instantiate_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_instantiate_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:instantiate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:instantiate", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the instantiate_inline_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_instantiate_inline_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workflowTemplates:instantiateInline", - body: "template", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workflowTemplates:instantiateInline", - body: "template", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :put, - uri_template: "/v1/{template.name}", - body: "template", - matches: [ - ["template.name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :put, - uri_template: "/v1/{template.name}", - body: "template", - matches: [ - ["template.name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workflow_templates REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_workflow_templates_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workflowTemplates", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workflowTemplates", - matches: [ - ["parent", %r{^projects/[^/]+/regions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workflow_template REST call - # - # @param request_pb [::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_workflow_template_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb b/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb deleted file mode 100644 index e104f64c2b4f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dataproc/v1/workflow_templates.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dataproc/v1/clusters_pb' -require 'google/cloud/dataproc/v1/jobs_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n1google/cloud/dataproc/v1/workflow_templates.proto\x12\x18google.cloud.dataproc.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/dataproc/v1/clusters.proto\x1a#google/cloud/dataproc/v1/jobs.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x82\x06\n\x10WorkflowTemplate\x12\x0f\n\x02id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12K\n\x06labels\x18\x06 \x03(\x0b\x32\x36.google.cloud.dataproc.v1.WorkflowTemplate.LabelsEntryB\x03\xe0\x41\x01\x12K\n\tplacement\x18\x07 \x01(\x0b\x32\x33.google.cloud.dataproc.v1.WorkflowTemplatePlacementB\x03\xe0\x41\x02\x12\x37\n\x04jobs\x18\x08 \x03(\x0b\x32$.google.cloud.dataproc.v1.OrderedJobB\x03\xe0\x41\x02\x12\x44\n\nparameters\x18\t \x03(\x0b\x32+.google.cloud.dataproc.v1.TemplateParameterB\x03\xe0\x41\x01\x12\x33\n\x0b\x64\x61g_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xca\x01\xea\x41\xc6\x01\n(dataproc.googleapis.com/WorkflowTemplate\x12Iprojects/{project}/regions/{region}/workflowTemplates/{workflow_template}\x12Mprojects/{project}/locations/{location}/workflowTemplates/{workflow_template} \x01\"\xb4\x01\n\x19WorkflowTemplatePlacement\x12\x43\n\x0fmanaged_cluster\x18\x01 \x01(\x0b\x32(.google.cloud.dataproc.v1.ManagedClusterH\x00\x12\x45\n\x10\x63luster_selector\x18\x02 \x01(\x0b\x32).google.cloud.dataproc.v1.ClusterSelectorH\x00\x42\x0b\n\tplacement\"\xe3\x01\n\x0eManagedCluster\x12\x19\n\x0c\x63luster_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\x06\x63onfig\x18\x03 \x01(\x0b\x32\'.google.cloud.dataproc.v1.ClusterConfigB\x03\xe0\x41\x02\x12I\n\x06labels\x18\x04 \x03(\x0b\x32\x34.google.cloud.dataproc.v1.ManagedCluster.LabelsEntryB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb5\x01\n\x0f\x43lusterSelector\x12\x11\n\x04zone\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Y\n\x0e\x63luster_labels\x18\x02 \x03(\x0b\x32<.google.cloud.dataproc.v1.ClusterSelector.ClusterLabelsEntryB\x03\xe0\x41\x02\x1a\x34\n\x12\x43lusterLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x06\n\nOrderedJob\x12\x14\n\x07step_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\nhadoop_job\x18\x02 \x01(\x0b\x32#.google.cloud.dataproc.v1.HadoopJobB\x03\xe0\x41\x01H\x00\x12<\n\tspark_job\x18\x03 \x01(\x0b\x32\".google.cloud.dataproc.v1.SparkJobB\x03\xe0\x41\x01H\x00\x12@\n\x0bpyspark_job\x18\x04 \x01(\x0b\x32$.google.cloud.dataproc.v1.PySparkJobB\x03\xe0\x41\x01H\x00\x12:\n\x08hive_job\x18\x05 \x01(\x0b\x32!.google.cloud.dataproc.v1.HiveJobB\x03\xe0\x41\x01H\x00\x12\x38\n\x07pig_job\x18\x06 \x01(\x0b\x32 .google.cloud.dataproc.v1.PigJobB\x03\xe0\x41\x01H\x00\x12?\n\x0bspark_r_job\x18\x0b \x01(\x0b\x32#.google.cloud.dataproc.v1.SparkRJobB\x03\xe0\x41\x01H\x00\x12\x43\n\rspark_sql_job\x18\x07 \x01(\x0b\x32%.google.cloud.dataproc.v1.SparkSqlJobB\x03\xe0\x41\x01H\x00\x12>\n\npresto_job\x18\x0c \x01(\x0b\x32#.google.cloud.dataproc.v1.PrestoJobB\x03\xe0\x41\x01H\x00\x12\x45\n\x06labels\x18\x08 \x03(\x0b\x32\x30.google.cloud.dataproc.v1.OrderedJob.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nscheduling\x18\t \x01(\x0b\x32\'.google.cloud.dataproc.v1.JobSchedulingB\x03\xe0\x41\x01\x12\"\n\x15prerequisite_step_ids\x18\n \x03(\tB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\n\n\x08job_type\"\x9d\x01\n\x11TemplateParameter\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06\x66ields\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x46\n\nvalidation\x18\x04 \x01(\x0b\x32-.google.cloud.dataproc.v1.ParameterValidationB\x03\xe0\x41\x01\"\xa1\x01\n\x13ParameterValidation\x12:\n\x05regex\x18\x01 \x01(\x0b\x32).google.cloud.dataproc.v1.RegexValidationH\x00\x12;\n\x06values\x18\x02 \x01(\x0b\x32).google.cloud.dataproc.v1.ValueValidationH\x00\x42\x11\n\x0fvalidation_type\"\'\n\x0fRegexValidation\x12\x14\n\x07regexes\x18\x01 \x03(\tB\x03\xe0\x41\x02\"&\n\x0fValueValidation\x12\x13\n\x06values\x18\x01 \x03(\tB\x03\xe0\x41\x02\"\xd4\x06\n\x10WorkflowMetadata\x12\x15\n\x08template\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12G\n\x0e\x63reate_cluster\x18\x03 \x01(\x0b\x32*.google.cloud.dataproc.v1.ClusterOperationB\x03\xe0\x41\x03\x12;\n\x05graph\x18\x04 \x01(\x0b\x32\'.google.cloud.dataproc.v1.WorkflowGraphB\x03\xe0\x41\x03\x12G\n\x0e\x64\x65lete_cluster\x18\x05 \x01(\x0b\x32*.google.cloud.dataproc.v1.ClusterOperationB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\x06 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.WorkflowMetadata.StateB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_name\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12N\n\nparameters\x18\x08 \x03(\x0b\x32:.google.cloud.dataproc.v1.WorkflowMetadata.ParametersEntry\x12\x33\n\nstart_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0c\x63luster_uuid\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12\x33\n\x0b\x64\x61g_timeout\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12\x37\n\x0e\x64\x61g_start_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x61g_end_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"8\n\x05State\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\"T\n\x10\x43lusterOperation\x12\x19\n\x0coperation_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05\x65rror\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x64one\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\"K\n\rWorkflowGraph\x12:\n\x05nodes\x18\x01 \x03(\x0b\x32&.google.cloud.dataproc.v1.WorkflowNodeB\x03\xe0\x41\x03\"\xa3\x02\n\x0cWorkflowNode\x12\x14\n\x07step_id\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\"\n\x15prerequisite_step_ids\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x13\n\x06job_id\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x44\n\x05state\x18\x05 \x01(\x0e\x32\x30.google.cloud.dataproc.v1.WorkflowNode.NodeStateB\x03\xe0\x41\x03\x12\x12\n\x05\x65rror\x18\x06 \x01(\tB\x03\xe0\x41\x03\"j\n\tNodeState\x12\x1a\n\x16NODE_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x42LOCKED\x10\x01\x12\x0c\n\x08RUNNABLE\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tCOMPLETED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\"\xa4\x01\n\x1d\x43reateWorkflowTemplateRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x41\n\x08template\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\"r\n\x1aGetWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xad\x02\n\"InstantiateWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x65\n\nparameters\x18\x06 \x03(\x0b\x32L.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.ParametersEntryB\x03\xe0\x41\x01\x1a\x31\n\x0fParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc8\x01\n(InstantiateInlineWorkflowTemplateRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x41\n\x08template\x18\x02 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x1dUpdateWorkflowTemplateRequest\x12\x41\n\x08template\x18\x01 \x01(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x02\"\x91\x01\n\x1cListWorkflowTemplatesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(dataproc.googleapis.com/WorkflowTemplate\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x81\x01\n\x1dListWorkflowTemplatesResponse\x12\x42\n\ttemplates\x18\x01 \x03(\x0b\x32*.google.cloud.dataproc.v1.WorkflowTemplateB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\"u\n\x1d\x44\x65leteWorkflowTemplateRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dataproc.googleapis.com/WorkflowTemplate\x12\x14\n\x07version\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x32\xe6\x10\n\x17WorkflowTemplateService\x12\x9b\x02\n\x16\x43reateWorkflowTemplate\x12\x37.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"\x9b\x01\xda\x41\x0fparent,template\x82\xd3\xe4\x93\x02\x82\x01\"5/v1/{parent=projects/*/locations/*}/workflowTemplates:\x08templateZ?\"3/v1/{parent=projects/*/regions/*}/workflowTemplates:\x08template\x12\xf4\x01\n\x13GetWorkflowTemplate\x12\x34.google.cloud.dataproc.v1.GetWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"{\xda\x41\x04name\x82\xd3\xe4\x93\x02n\x12\x35/v1/{name=projects/*/locations/*/workflowTemplates/*}Z5\x12\x33/v1/{name=projects/*/regions/*/workflowTemplates/*}\x12\xd5\x02\n\x1bInstantiateWorkflowTemplate\x12<.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xd8\x01\xca\x41)\n\x15google.protobuf.Empty\x12\x10WorkflowMetadata\xda\x41\x04name\xda\x41\x0fname,parameters\x82\xd3\xe4\x93\x02\x8c\x01\"A/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate:\x01*ZD\"?/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate:\x01*\x12\xf4\x02\n!InstantiateInlineWorkflowTemplate\x12\x42.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41)\n\x15google.protobuf.Empty\x12\x10WorkflowMetadata\xda\x41\x0fparent,template\x82\xd3\xe4\x93\x02\xa6\x01\"G/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline:\x08templateZQ\"E/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline:\x08template\x12\xa6\x02\n\x16UpdateWorkflowTemplate\x12\x37.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest\x1a*.google.cloud.dataproc.v1.WorkflowTemplate\"\xa6\x01\xda\x41\x08template\x82\xd3\xe4\x93\x02\x94\x01\x1a>/v1/{template.name=projects/*/locations/*/workflowTemplates/*}:\x08templateZH\x1a] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 935946d52792..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb deleted file mode 100644 index 96d21ebb27bf..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb +++ /dev/null @@ -1,296 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # Describes an autoscaling policy for Dataproc cluster autoscaler. - # @!attribute [rw] id - # @return [::String] - # Required. The policy id. - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of between 3 and 50 characters. - # @!attribute [r] name - # @return [::String] - # Output only. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies`, the resource name of the - # policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies`, the resource name of the - # policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - # @!attribute [rw] basic_algorithm - # @return [::Google::Cloud::Dataproc::V1::BasicAutoscalingAlgorithm] - # @!attribute [rw] worker_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupAutoscalingPolicyConfig] - # Required. Describes how the autoscaler will operate for primary workers. - # @!attribute [rw] secondary_worker_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupAutoscalingPolicyConfig] - # Optional. Describes how the autoscaler will operate for secondary workers. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this autoscaling policy. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with an autoscaling policy. - class AutoscalingPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Basic algorithm for autoscaling. - # @!attribute [rw] yarn_config - # @return [::Google::Cloud::Dataproc::V1::BasicYarnAutoscalingConfig] - # Required. YARN autoscaling configuration. - # @!attribute [rw] cooldown_period - # @return [::Google::Protobuf::Duration] - # Optional. Duration between scaling events. A scaling period starts after - # the update operation from the previous event has completed. - # - # Bounds: [2m, 1d]. Default: 2m. - class BasicAutoscalingAlgorithm - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Basic autoscaling configurations for YARN. - # @!attribute [rw] graceful_decommission_timeout - # @return [::Google::Protobuf::Duration] - # Required. Timeout for YARN graceful decommissioning of Node Managers. - # Specifies the duration to wait for jobs to complete before forcefully - # removing workers (and potentially interrupting jobs). Only applicable to - # downscaling operations. - # - # Bounds: [0s, 1d]. - # @!attribute [rw] scale_up_factor - # @return [::Float] - # Required. Fraction of average YARN pending memory in the last cooldown - # period for which to add workers. A scale-up factor of 1.0 will result in - # scaling up so that there is no pending memory remaining after the update - # (more aggressive scaling). A scale-up factor closer to 0 will result in a - # smaller magnitude of scaling up (less aggressive scaling). See [How - # autoscaling - # works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) - # for more information. - # - # Bounds: [0.0, 1.0]. - # @!attribute [rw] scale_down_factor - # @return [::Float] - # Required. Fraction of average YARN pending memory in the last cooldown - # period for which to remove workers. A scale-down factor of 1 will result in - # scaling down so that there is no available memory remaining after the - # update (more aggressive scaling). A scale-down factor of 0 disables - # removing workers, which can be beneficial for autoscaling a single job. - # See [How autoscaling - # works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) - # for more information. - # - # Bounds: [0.0, 1.0]. - # @!attribute [rw] scale_up_min_worker_fraction - # @return [::Float] - # Optional. Minimum scale-up threshold as a fraction of total cluster size - # before scaling occurs. For example, in a 20-worker cluster, a threshold of - # 0.1 means the autoscaler must recommend at least a 2-worker scale-up for - # the cluster to scale. A threshold of 0 means the autoscaler will scale up - # on any recommended change. - # - # Bounds: [0.0, 1.0]. Default: 0.0. - # @!attribute [rw] scale_down_min_worker_fraction - # @return [::Float] - # Optional. Minimum scale-down threshold as a fraction of total cluster size - # before scaling occurs. For example, in a 20-worker cluster, a threshold of - # 0.1 means the autoscaler must recommend at least a 2 worker scale-down for - # the cluster to scale. A threshold of 0 means the autoscaler will scale down - # on any recommended change. - # - # Bounds: [0.0, 1.0]. Default: 0.0. - class BasicYarnAutoscalingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for the size bounds of an instance group, including its - # proportional size to other groups. - # @!attribute [rw] min_instances - # @return [::Integer] - # Optional. Minimum number of instances for this group. - # - # Primary workers - Bounds: [2, max_instances]. Default: 2. - # Secondary workers - Bounds: [0, max_instances]. Default: 0. - # @!attribute [rw] max_instances - # @return [::Integer] - # Required. Maximum number of instances for this group. Required for primary - # workers. Note that by default, clusters will not use secondary workers. - # Required for secondary workers if the minimum secondary instances is set. - # - # Primary workers - Bounds: [min_instances, ). - # Secondary workers - Bounds: [min_instances, ). Default: 0. - # @!attribute [rw] weight - # @return [::Integer] - # Optional. Weight for the instance group, which is used to determine the - # fraction of total workers in the cluster from this instance group. - # For example, if primary workers have weight 2, and secondary workers have - # weight 1, the cluster will have approximately 2 primary workers for each - # secondary worker. - # - # The cluster may not reach the specified balance if constrained - # by min/max bounds or other autoscaling settings. For example, if - # `max_instances` for secondary workers is 0, then only primary workers will - # be added. The cluster can also be out of balance when created. - # - # If weight is not set on any instance group, the cluster will default to - # equal weight for all groups: the cluster will attempt to maintain an equal - # number of workers in each group within the configured size bounds for each - # group. If weight is set for one group only, the cluster will default to - # zero weight on the unset group. For example if weight is set only on - # primary workers, the cluster will use primary workers only and no - # secondary workers. - class InstanceGroupAutoscalingPolicyConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to create an autoscaling policy. - # @!attribute [rw] parent - # @return [::String] - # Required. The "resource name" of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.create`, the resource name - # of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.autoscalingPolicies.create`, the resource name - # of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @!attribute [rw] policy - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # Required. The autoscaling policy to create. - class CreateAutoscalingPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to fetch an autoscaling policy. - # @!attribute [rw] name - # @return [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.get`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - class GetAutoscalingPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to update an autoscaling policy. - # @!attribute [rw] policy - # @return [::Google::Cloud::Dataproc::V1::AutoscalingPolicy] - # Required. The updated autoscaling policy. - class UpdateAutoscalingPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete an autoscaling policy. - # - # Autoscaling policies in use by one or more clusters will not be deleted. - # @!attribute [rw] name - # @return [::String] - # Required. The "resource name" of the autoscaling policy, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - # - # * For `projects.locations.autoscalingPolicies.delete`, the resource name - # of the policy has the following format: - # `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - class DeleteAutoscalingPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list autoscaling policies in a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The "resource name" of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.autoscalingPolicies.list`, the resource name - # of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.autoscalingPolicies.list`, the resource name - # of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in each response. - # Must be less than or equal to 1000. Defaults to 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - class ListAutoscalingPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A response to a request to list autoscaling policies in a project. - # @!attribute [r] policies - # @return [::Array<::Google::Cloud::Dataproc::V1::AutoscalingPolicy>] - # Output only. Autoscaling policies list. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. This token is included in the response if there are more - # results to fetch. - class ListAutoscalingPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb deleted file mode 100644 index b018cccf8325..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/batches.rb +++ /dev/null @@ -1,367 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # A request to create a batch workload. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this batch will be created. - # @!attribute [rw] batch - # @return [::Google::Cloud::Dataproc::V1::Batch] - # Required. The batch to create. - # @!attribute [rw] batch_id - # @return [::String] - # Optional. The ID to use for the batch, which will become the final - # component of the batch's resource name. - # - # This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - # with the same request_id, the second request is ignored and the - # Operation that corresponds to the first Batch created and stored - # in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class CreateBatchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get the resource representation for a batch workload. - # @!attribute [rw] name - # @return [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - class GetBatchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list batch workloads in a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of batches. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of batches to return in each response. - # The service may return fewer than this value. - # The default page size is 20; the maximum page size is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token received from a previous `ListBatches` call. - # Provide this token to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter for the batches to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each batch resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND/OR). - # Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - # - # e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - # filters for batches in state RUNNING that were created before 2023-01-01 - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparisons. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Field(s) on which to sort the list of batches. - # - # Currently the only supported sort orders are unspecified (empty) and - # `create_time desc` to sort by most recently created batches first. - # - # See https://google.aip.dev/132#ordering for more details. - class ListBatchesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of batch workloads. - # @!attribute [rw] batches - # @return [::Array<::Google::Cloud::Dataproc::V1::Batch>] - # The batches from the specified collection. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListBatchesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a batch workload. - # @!attribute [rw] name - # @return [::String] - # Required. The fully qualified name of the batch to retrieve - # in the format - # "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - class DeleteBatchRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A representation of a batch workload in the service. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the batch. - # @!attribute [r] uuid - # @return [::String] - # Output only. A batch UUID (Unique Universal Identifier). The service - # generates this value when it creates the batch. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the batch was created. - # @!attribute [rw] pyspark_batch - # @return [::Google::Cloud::Dataproc::V1::PySparkBatch] - # Optional. PySpark batch config. - # @!attribute [rw] spark_batch - # @return [::Google::Cloud::Dataproc::V1::SparkBatch] - # Optional. Spark batch config. - # @!attribute [rw] spark_r_batch - # @return [::Google::Cloud::Dataproc::V1::SparkRBatch] - # Optional. SparkR batch config. - # @!attribute [rw] spark_sql_batch - # @return [::Google::Cloud::Dataproc::V1::SparkSqlBatch] - # Optional. SparkSql batch config. - # @!attribute [r] runtime_info - # @return [::Google::Cloud::Dataproc::V1::RuntimeInfo] - # Output only. Runtime information about batch execution. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::Batch::State] - # Output only. The state of the batch. - # @!attribute [r] state_message - # @return [::String] - # Output only. Batch state details, such as a failure - # description if the state is `FAILED`. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the batch entered a current state. - # @!attribute [r] creator - # @return [::String] - # Output only. The email address of the user who created the batch. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this batch. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with a batch. - # @!attribute [rw] runtime_config - # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] - # Optional. Runtime configuration for the batch execution. - # @!attribute [rw] environment_config - # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] - # Optional. Environment configuration for the batch execution. - # @!attribute [r] operation - # @return [::String] - # Output only. The resource name of the operation associated with this batch. - # @!attribute [r] state_history - # @return [::Array<::Google::Cloud::Dataproc::V1::Batch::StateHistory>] - # Output only. Historical state information for the batch. - class Batch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Historical state information. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::Batch::State] - # Output only. The state of the batch at this point in history. - # @!attribute [r] state_message - # @return [::String] - # Output only. Details about the state at this point in history. - # @!attribute [r] state_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the batch entered the historical state. - class StateHistory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The batch state. - module State - # The batch state is unknown. - STATE_UNSPECIFIED = 0 - - # The batch is created before running. - PENDING = 1 - - # The batch is running. - RUNNING = 2 - - # The batch is cancelling. - CANCELLING = 3 - - # The batch cancellation was successful. - CANCELLED = 4 - - # The batch completed successfully. - SUCCEEDED = 5 - - # The batch is no longer running due to an error. - FAILED = 6 - end - end - - # A configuration for running an - # [Apache - # PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html) - # batch workload. - # @!attribute [rw] main_python_file_uri - # @return [::String] - # Required. The HCFS URI of the main Python file to use as the Spark driver. - # Must be a .py file. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not include arguments - # that can be set as batch properties, such as `--conf`, since a collision - # can occur that causes an incorrect batch submission. - # @!attribute [rw] python_file_uris - # @return [::Array<::String>] - # Optional. HCFS file URIs of Python files to pass to the PySpark - # framework. Supported file types: `.py`, `.egg`, and `.zip`. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the classpath of the - # Spark driver and tasks. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - class PySparkBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A configuration for running an [Apache Spark](https://spark.apache.org/) - # batch workload. - # @!attribute [rw] main_jar_file_uri - # @return [::String] - # Optional. The HCFS URI of the jar file that contains the main class. - # @!attribute [rw] main_class - # @return [::String] - # Optional. The name of the driver main class. The jar file that contains - # the class must be in the classpath or specified in `jar_file_uris`. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not include arguments - # that can be set as batch properties, such as `--conf`, since a collision - # can occur that causes an incorrect batch submission. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the classpath of the - # Spark driver and tasks. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - class SparkBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A configuration for running an - # [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) - # batch workload. - # @!attribute [rw] main_r_file_uri - # @return [::String] - # Required. The HCFS URI of the main R file to use as the driver. - # Must be a `.R` or `.r` file. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the Spark driver. Do not include - # arguments that can be set as batch properties, such as `--conf`, since a - # collision can occur that causes an incorrect batch submission. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - class SparkRBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A configuration for running - # [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch - # workload. - # @!attribute [rw] query_file_uri - # @return [::String] - # Required. The HCFS URI of the script that contains Spark SQL queries to - # execute. - # @!attribute [rw] query_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Mapping of query variable names to values (equivalent to the - # Spark SQL command: `SET name="value";`). - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - class SparkSqlBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class QueryVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb deleted file mode 100644 index 4c884f6fe466..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/clusters.rb +++ /dev/null @@ -1,1627 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # Describes the identifying information, config, and status of - # a Dataproc cluster - # @!attribute [rw] project_id - # @return [::String] - # Required. The Google Cloud Platform project ID that the cluster belongs to. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name, which must be unique within a project. - # The name must start with a lowercase letter, and can contain - # up to 51 lowercase letters, numbers, and hyphens. It cannot end - # with a hyphen. The name of a deleted cluster can be reused. - # @!attribute [rw] config - # @return [::Google::Cloud::Dataproc::V1::ClusterConfig] - # Optional. The cluster config for a cluster of Compute Engine Instances. - # Note that Dataproc may set default values, and values may change - # when clusters are updated. - # - # Exactly one of ClusterConfig or VirtualClusterConfig must be specified. - # @!attribute [rw] virtual_cluster_config - # @return [::Google::Cloud::Dataproc::V1::VirtualClusterConfig] - # Optional. The virtual cluster config is used when creating a Dataproc - # cluster that does not directly control the underlying compute resources, - # for example, when creating a [Dataproc-on-GKE - # cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). - # Dataproc may set default values, and values may change when - # clusters are updated. Exactly one of - # {::Google::Cloud::Dataproc::V1::Cluster#config config} or - # {::Google::Cloud::Dataproc::V1::Cluster#virtual_cluster_config virtual_cluster_config} - # must be specified. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this cluster. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with a cluster. - # @!attribute [r] status - # @return [::Google::Cloud::Dataproc::V1::ClusterStatus] - # Output only. Cluster status. - # @!attribute [r] status_history - # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterStatus>] - # Output only. The previous cluster status. - # @!attribute [r] cluster_uuid - # @return [::String] - # Output only. A cluster UUID (Unique Universal Identifier). Dataproc - # generates this value when it creates the cluster. - # @!attribute [r] metrics - # @return [::Google::Cloud::Dataproc::V1::ClusterMetrics] - # Output only. Contains cluster daemon metrics such as HDFS and YARN stats. - # - # **Beta Feature**: This report is available for testing purposes only. It - # may be changed before final release. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The cluster config. - # @!attribute [rw] config_bucket - # @return [::String] - # Optional. A Cloud Storage bucket used to stage job - # dependencies, config files, and job driver console output. - # If you do not specify a staging bucket, Cloud - # Dataproc will determine a Cloud Storage location (US, - # ASIA, or EU) for your cluster's staging bucket according to the - # Compute Engine zone where your cluster is deployed, and then create - # and manage this project-level, per-location 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.** - # @!attribute [rw] temp_bucket - # @return [::String] - # 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.** - # @!attribute [rw] gce_cluster_config - # @return [::Google::Cloud::Dataproc::V1::GceClusterConfig] - # Optional. The shared Compute Engine config settings for - # all instances in a cluster. - # @!attribute [rw] master_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] - # Optional. The Compute Engine config settings for - # the cluster's master instance. - # @!attribute [rw] worker_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] - # Optional. The Compute Engine config settings for - # the cluster's worker instances. - # @!attribute [rw] secondary_worker_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] - # Optional. The Compute Engine config settings for - # a cluster's secondary worker instances - # @!attribute [rw] software_config - # @return [::Google::Cloud::Dataproc::V1::SoftwareConfig] - # Optional. The config settings for cluster software. - # @!attribute [rw] initialization_actions - # @return [::Array<::Google::Cloud::Dataproc::V1::NodeInitializationAction>] - # Optional. Commands to execute on each node after config is - # completed. By default, executables are run on master and all worker nodes. - # You can test a node's `role` metadata to run an executable on - # a master or worker node, as shown below using `curl` (you can also use - # `wget`): - # - # ROLE=$(curl -H Metadata-Flavor:Google - # http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) - # if [[ "${ROLE}" == 'Master' ]]; then - # ... master specific actions ... - # else - # ... worker specific actions ... - # fi - # @!attribute [rw] encryption_config - # @return [::Google::Cloud::Dataproc::V1::EncryptionConfig] - # Optional. Encryption settings for the cluster. - # @!attribute [rw] autoscaling_config - # @return [::Google::Cloud::Dataproc::V1::AutoscalingConfig] - # Optional. Autoscaling config for the policy associated with the cluster. - # Cluster does not autoscale if this field is unset. - # @!attribute [rw] security_config - # @return [::Google::Cloud::Dataproc::V1::SecurityConfig] - # Optional. Security settings for the cluster. - # @!attribute [rw] lifecycle_config - # @return [::Google::Cloud::Dataproc::V1::LifecycleConfig] - # Optional. Lifecycle setting for the cluster. - # @!attribute [rw] endpoint_config - # @return [::Google::Cloud::Dataproc::V1::EndpointConfig] - # Optional. Port/endpoint configuration for this cluster - # @!attribute [rw] metastore_config - # @return [::Google::Cloud::Dataproc::V1::MetastoreConfig] - # Optional. Metastore configuration. - # @!attribute [rw] dataproc_metric_config - # @return [::Google::Cloud::Dataproc::V1::DataprocMetricConfig] - # Optional. The config for Dataproc metrics. - # @!attribute [rw] auxiliary_node_groups - # @return [::Array<::Google::Cloud::Dataproc::V1::AuxiliaryNodeGroup>] - # Optional. The node group settings. - class ClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Dataproc cluster config for a cluster that does not directly control the - # underlying compute resources, such as a [Dataproc-on-GKE - # cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). - # @!attribute [rw] staging_bucket - # @return [::String] - # Optional. A Cloud Storage bucket used to stage job - # dependencies, config files, and job driver console output. - # If you do not specify a staging bucket, Cloud - # Dataproc will determine a Cloud Storage location (US, - # ASIA, or EU) for your cluster's staging bucket according to the - # Compute Engine zone where your cluster is deployed, and then create - # and manage this project-level, per-location 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.** - # @!attribute [rw] kubernetes_cluster_config - # @return [::Google::Cloud::Dataproc::V1::KubernetesClusterConfig] - # Required. The configuration for running the Dataproc cluster on - # Kubernetes. - # @!attribute [rw] auxiliary_services_config - # @return [::Google::Cloud::Dataproc::V1::AuxiliaryServicesConfig] - # Optional. Configuration of auxiliary services used by this cluster. - class VirtualClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Auxiliary services configuration for a Cluster. - # @!attribute [rw] metastore_config - # @return [::Google::Cloud::Dataproc::V1::MetastoreConfig] - # Optional. The Hive Metastore configuration for this workload. - # @!attribute [rw] spark_history_server_config - # @return [::Google::Cloud::Dataproc::V1::SparkHistoryServerConfig] - # Optional. The Spark History Server configuration for the workload. - class AuxiliaryServicesConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Endpoint config for this cluster - # @!attribute [r] http_ports - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. The map of port descriptions to URLs. Will only be populated - # if enable_http_port_access is true. - # @!attribute [rw] enable_http_port_access - # @return [::Boolean] - # Optional. If true, enable http access to specific ports on the cluster - # from external sources. Defaults to false. - class EndpointConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class HttpPortsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Autoscaling Policy config associated with the cluster. - # @!attribute [rw] policy_uri - # @return [::String] - # Optional. The autoscaling policy used by the cluster. - # - # Only resource names including projectid and location (region) are valid. - # Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` - # * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` - # - # Note that the policy must be in the same project and Dataproc region. - class AutoscalingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Encryption settings for the cluster. - # @!attribute [rw] gce_pd_kms_key_name - # @return [::String] - # Optional. The Cloud KMS key name to use for PD disk encryption for all - # instances in the cluster. - class EncryptionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Common config settings for resources of Compute Engine cluster - # instances, applicable to all instances in the cluster. - # @!attribute [rw] zone_uri - # @return [::String] - # Optional. The Compute Engine zone where the Dataproc cluster will be - # located. If omitted, the service will pick a zone in the cluster's Compute - # Engine region. On a get request, zone will always be present. - # - # A full URL, partial URI, or short name are valid. Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]` - # * `projects/[project_id]/zones/[zone]` - # * `[zone]` - # @!attribute [rw] network_uri - # @return [::String] - # Optional. The Compute Engine network to be used for machine - # communications. Cannot be specified with subnetwork_uri. If neither - # `network_uri` nor `subnetwork_uri` is specified, the "default" network of - # the project is used, if it exists. Cannot be a "Custom Subnet Network" (see - # [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for - # more information). - # - # A full URL, partial URI, or short name are valid. Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` - # * `projects/[project_id]/global/networks/default` - # * `default` - # @!attribute [rw] subnetwork_uri - # @return [::String] - # Optional. The Compute Engine subnetwork to be used for machine - # communications. Cannot be specified with network_uri. - # - # A full URL, partial URI, or short name are valid. Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/[region]/subnetworks/sub0` - # * `projects/[project_id]/regions/[region]/subnetworks/sub0` - # * `sub0` - # @!attribute [rw] internal_ip_only - # @return [::Boolean] - # Optional. If true, all instances in the cluster will only have internal IP - # addresses. By default, clusters are not restricted to internal IP - # addresses, and will have ephemeral external IP addresses assigned to each - # instance. This `internal_ip_only` restriction can only be enabled for - # subnetwork enabled networks, and all off-cluster dependencies must be - # configured to be accessible without external IP addresses. - # @!attribute [rw] private_ipv6_google_access - # @return [::Google::Cloud::Dataproc::V1::GceClusterConfig::PrivateIpv6GoogleAccess] - # Optional. The type of IPv6 access for a cluster. - # @!attribute [rw] service_account - # @return [::String] - # Optional. The [Dataproc service - # account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) - # (also see [VM Data Plane - # identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) - # used by Dataproc cluster VM instances to access Google Cloud Platform - # services. - # - # If not specified, the - # [Compute Engine default service - # account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - # is used. - # @!attribute [rw] service_account_scopes - # @return [::Array<::String>] - # Optional. The URIs of service account scopes to be included in - # Compute Engine instances. The following base set of scopes is always - # included: - # - # * https://www.googleapis.com/auth/cloud.useraccounts.readonly - # * https://www.googleapis.com/auth/devstorage.read_write - # * https://www.googleapis.com/auth/logging.write - # - # If no scopes are specified, the following defaults are also provided: - # - # * https://www.googleapis.com/auth/bigquery - # * https://www.googleapis.com/auth/bigtable.admin.table - # * https://www.googleapis.com/auth/bigtable.data - # * https://www.googleapis.com/auth/devstorage.full_control - # @!attribute [rw] tags - # @return [::Array<::String>] - # The Compute Engine tags to add to all instances (see [Tagging - # instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The Compute Engine metadata entries to add to all instances (see - # [Project and instance - # metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). - # @!attribute [rw] reservation_affinity - # @return [::Google::Cloud::Dataproc::V1::ReservationAffinity] - # Optional. Reservation Affinity for consuming Zonal reservation. - # @!attribute [rw] node_group_affinity - # @return [::Google::Cloud::Dataproc::V1::NodeGroupAffinity] - # Optional. Node Group Affinity for sole-tenant clusters. - # @!attribute [rw] shielded_instance_config - # @return [::Google::Cloud::Dataproc::V1::ShieldedInstanceConfig] - # Optional. Shielded Instance Config for clusters using [Compute Engine - # Shielded - # VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). - # @!attribute [rw] confidential_instance_config - # @return [::Google::Cloud::Dataproc::V1::ConfidentialInstanceConfig] - # Optional. Confidential Instance Config for clusters using [Confidential - # VMs](https://cloud.google.com/compute/confidential-vm/docs). - class GceClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes - # can communicate with Google Services through gRPC over IPv6. - # These values are directly mapped to corresponding values in the - # [Compute Engine Instance - # fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances). - module PrivateIpv6GoogleAccess - # If unspecified, Compute Engine default behavior will apply, which - # is the same as - # {::Google::Cloud::Dataproc::V1::GceClusterConfig::PrivateIpv6GoogleAccess::INHERIT_FROM_SUBNETWORK INHERIT_FROM_SUBNETWORK}. - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0 - - # Private access to and from Google Services configuration - # inherited from the subnetwork configuration. This is the - # default Compute Engine behavior. - INHERIT_FROM_SUBNETWORK = 1 - - # Enables outbound private IPv6 access to Google Services from the Dataproc - # cluster. - OUTBOUND = 2 - - # Enables bidirectional private IPv6 access between Google Services and the - # Dataproc cluster. - BIDIRECTIONAL = 3 - end - end - - # Node Group Affinity for clusters using sole-tenant node groups. - # **The Dataproc `NodeGroupAffinity` resource is not related to the - # Dataproc {::Google::Cloud::Dataproc::V1::NodeGroup NodeGroup} resource.** - # @!attribute [rw] node_group_uri - # @return [::String] - # Required. The URI of a - # sole-tenant [node group - # resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) - # that the cluster will be created on. - # - # A full URL, partial URI, or node group name are valid. Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` - # * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` - # * `node-group-1` - class NodeGroupAffinity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Shielded Instance Config for clusters using [Compute Engine Shielded - # VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). - # @!attribute [rw] enable_secure_boot - # @return [::Boolean] - # Optional. Defines whether instances have Secure Boot enabled. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Defines whether instances have the vTPM enabled. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Defines whether instances have integrity monitoring enabled. - class ShieldedInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Confidential Instance Config for clusters using [Confidential - # VMs](https://cloud.google.com/compute/confidential-vm/docs) - # @!attribute [rw] enable_confidential_compute - # @return [::Boolean] - # Optional. Defines whether the instance should have confidential compute - # enabled. - class ConfidentialInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The config settings for Compute Engine resources in - # an instance group, such as a master or worker group. - # @!attribute [rw] num_instances - # @return [::Integer] - # Optional. The number of VM instances in the instance group. - # For [HA - # cluster](/dataproc/docs/concepts/configuring-clusters/high-availability) - # [master_config](#FIELDS.master_config) groups, **must be set to 3**. - # For standard cluster [master_config](#FIELDS.master_config) groups, - # **must be set to 1**. - # @!attribute [r] instance_names - # @return [::Array<::String>] - # Output only. The list of instance names. Dataproc derives the names - # from `cluster_name`, `num_instances`, and the instance group. - # @!attribute [r] instance_references - # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceReference>] - # Output only. List of references to Compute Engine instances. - # @!attribute [rw] image_uri - # @return [::String] - # Optional. The Compute Engine image resource used for cluster instances. - # - # The URI can represent an image or image family. - # - # Image examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/[image-id]` - # * `projects/[project_id]/global/images/[image-id]` - # * `image-id` - # - # Image family examples. Dataproc will use the most recent - # image from the family: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/family/[custom-image-family-name]` - # * `projects/[project_id]/global/images/family/[custom-image-family-name]` - # - # If the URI is unspecified, it will be inferred from - # `SoftwareConfig.image_version` or the system default. - # @!attribute [rw] machine_type_uri - # @return [::String] - # Optional. The Compute Engine machine type used for cluster instances. - # - # A full URL, partial URI, or short name are valid. Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` - # * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` - # * `n1-standard-2` - # - # **Auto Zone Exception**: If you are using the Dataproc - # [Auto Zone - # Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) - # feature, you must use the short name of the machine type - # resource, for example, `n1-standard-2`. - # @!attribute [rw] disk_config - # @return [::Google::Cloud::Dataproc::V1::DiskConfig] - # Optional. Disk option config settings. - # @!attribute [r] is_preemptible - # @return [::Boolean] - # Output only. Specifies that this instance group contains preemptible - # instances. - # @!attribute [rw] preemptibility - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig::Preemptibility] - # Optional. Specifies the preemptibility of the instance group. - # - # The default value for master and worker groups is - # `NON_PREEMPTIBLE`. This default cannot be changed. - # - # The default value for secondary instances is - # `PREEMPTIBLE`. - # @!attribute [r] managed_group_config - # @return [::Google::Cloud::Dataproc::V1::ManagedGroupConfig] - # Output only. The config for Compute Engine Instance Group - # Manager that manages this group. - # This is only used for preemptible instance groups. - # @!attribute [rw] accelerators - # @return [::Array<::Google::Cloud::Dataproc::V1::AcceleratorConfig>] - # Optional. The Compute Engine accelerator configuration for these - # instances. - # @!attribute [rw] min_cpu_platform - # @return [::String] - # Optional. Specifies the minimum cpu platform for the Instance Group. - # See [Dataproc -> Minimum CPU - # Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). - # @!attribute [rw] min_num_instances - # @return [::Integer] - # Optional. The minimum number of primary worker instances to create. - # If `min_num_instances` is set, cluster creation will succeed if - # the number of primary workers created is at least equal to the - # `min_num_instances` number. - # - # Example: Cluster creation request with `num_instances` = `5` and - # `min_num_instances` = `3`: - # - # * If 4 VMs are created and 1 instance fails, - # the failed VM is deleted. The cluster is - # resized to 4 instances and placed in a `RUNNING` state. - # * If 2 instances are created and 3 instances fail, - # the cluster in placed in an `ERROR` state. The failed VMs - # are not deleted. - # @!attribute [rw] instance_flexibility_policy - # @return [::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy] - # Optional. Instance flexibility Policy allowing a mixture of VM shapes and - # provisioning models. - # @!attribute [rw] startup_config - # @return [::Google::Cloud::Dataproc::V1::StartupConfig] - # Optional. Configuration to handle the startup of instances during cluster - # create and update process. - class InstanceGroupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Controls the use of preemptible instances within the group. - module Preemptibility - # Preemptibility is unspecified, the system will choose the - # appropriate setting for each instance group. - PREEMPTIBILITY_UNSPECIFIED = 0 - - # Instances are non-preemptible. - # - # This option is allowed for all instance groups and is the only valid - # value for Master and Worker instance groups. - NON_PREEMPTIBLE = 1 - - # Instances are [preemptible] - # (https://cloud.google.com/compute/docs/instances/preemptible). - # - # This option is allowed only for [secondary worker] - # (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) - # groups. - PREEMPTIBLE = 2 - - # Instances are [Spot VMs] - # (https://cloud.google.com/compute/docs/instances/spot). - # - # This option is allowed only for [secondary worker] - # (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) - # groups. Spot VMs are the latest version of [preemptible VMs] - # (https://cloud.google.com/compute/docs/instances/preemptible), and - # provide additional features. - SPOT = 3 - end - end - - # Configuration to handle the startup of instances during cluster create and - # update process. - # @!attribute [rw] required_registration_fraction - # @return [::Float] - # Optional. The config setting to enable cluster creation/ updation to be - # successful only after required_registration_fraction of instances are up - # and running. This configuration is applicable to only secondary workers for - # now. The cluster will fail if required_registration_fraction of instances - # are not available. This will include instance creation, agent registration, - # and service registration (if enabled). - class StartupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A reference to a Compute Engine instance. - # @!attribute [rw] instance_name - # @return [::String] - # The user-friendly name of the Compute Engine instance. - # @!attribute [rw] instance_id - # @return [::String] - # The unique identifier of the Compute Engine instance. - # @!attribute [rw] public_key - # @return [::String] - # The public RSA key used for sharing data with this instance. - # @!attribute [rw] public_ecies_key - # @return [::String] - # The public ECIES key used for sharing data with this instance. - class InstanceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the resources used to actively manage an instance group. - # @!attribute [r] instance_template_name - # @return [::String] - # Output only. The name of the Instance Template used for the Managed - # Instance Group. - # @!attribute [r] instance_group_manager_name - # @return [::String] - # Output only. The name of the Instance Group Manager for this group. - # @!attribute [r] instance_group_manager_uri - # @return [::String] - # Output only. The partial URI to the instance group manager for this group. - # E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm. - class ManagedGroupConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instance flexibility Policy allowing a mixture of VM shapes and provisioning - # models. - # @!attribute [rw] instance_selection_list - # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy::InstanceSelection>] - # Optional. List of instance selection options that the group will use when - # creating new VMs. - # @!attribute [r] instance_selection_results - # @return [::Array<::Google::Cloud::Dataproc::V1::InstanceFlexibilityPolicy::InstanceSelectionResult>] - # Output only. A list of instance selection results in the group. - class InstanceFlexibilityPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines machines types and a rank to which the machines types belong. - # @!attribute [rw] machine_types - # @return [::Array<::String>] - # Optional. Full machine-type names, e.g. "n1-standard-16". - # @!attribute [rw] rank - # @return [::Integer] - # Optional. Preference of this instance selection. Lower number means - # higher preference. Dataproc will first try to create a VM based on the - # machine-type with priority rank and fallback to next rank based on - # availability. Machine types and instance selections with the same - # priority have the same preference. - class InstanceSelection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines a mapping from machine types to the number of VMs that are created - # with each machine type. - # @!attribute [r] machine_type - # @return [::String] - # Output only. Full machine-type names, e.g. "n1-standard-16". - # @!attribute [r] vm_count - # @return [::Integer] - # Output only. Number of VM provisioned with the machine_type. - class InstanceSelectionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Specifies the type and number of accelerator cards attached to the instances - # of an instance. See [GPUs on Compute - # Engine](https://cloud.google.com/compute/docs/gpus/). - # @!attribute [rw] accelerator_type_uri - # @return [::String] - # Full URL, partial URI, or short name of the accelerator type resource to - # expose to this instance. See - # [Compute Engine - # AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes). - # - # Examples: - # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80` - # * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-k80` - # * `nvidia-tesla-k80` - # - # **Auto Zone Exception**: If you are using the Dataproc - # [Auto Zone - # Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) - # feature, you must use the short name of the accelerator type - # resource, for example, `nvidia-tesla-k80`. - # @!attribute [rw] accelerator_count - # @return [::Integer] - # The number of the accelerator cards of this type exposed to this instance. - class AcceleratorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the config of disk options for a group of VM instances. - # @!attribute [rw] boot_disk_type - # @return [::String] - # Optional. Type of the boot disk (default is "pd-standard"). - # Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive), - # "pd-ssd" (Persistent Disk Solid State Drive), - # or "pd-standard" (Persistent Disk Hard Disk Drive). - # See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types). - # @!attribute [rw] boot_disk_size_gb - # @return [::Integer] - # Optional. Size in GB of the boot disk (default is 500GB). - # @!attribute [rw] num_local_ssds - # @return [::Integer] - # Optional. Number of attached SSDs, from 0 to 8 (default is 0). - # If SSDs are not attached, the boot disk is used to store runtime logs and - # [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. - # If one or more SSDs are attached, this runtime bulk - # data is spread across them, and the boot disk contains only basic - # config and installed binaries. - # - # Note: Local SSD options may vary by machine type and number of vCPUs - # selected. - # @!attribute [rw] local_ssd_interface - # @return [::String] - # Optional. Interface type of local SSDs (default is "scsi"). - # Valid values: "scsi" (Small Computer System Interface), - # "nvme" (Non-Volatile Memory Express). - # See [local SSD - # performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance). - class DiskConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Node group identification and configuration information. - # @!attribute [rw] node_group - # @return [::Google::Cloud::Dataproc::V1::NodeGroup] - # Required. Node group configuration. - # @!attribute [rw] node_group_id - # @return [::String] - # Optional. A node group ID. Generated if not specified. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of from 3 to 33 characters. - class AuxiliaryNodeGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dataproc Node Group. - # **The Dataproc `NodeGroup` resource is not related to the - # Dataproc {::Google::Cloud::Dataproc::V1::NodeGroupAffinity NodeGroupAffinity} - # resource.** - # @!attribute [rw] name - # @return [::String] - # The Node group [resource name](https://aip.dev/122). - # @!attribute [rw] roles - # @return [::Array<::Google::Cloud::Dataproc::V1::NodeGroup::Role>] - # Required. Node group roles. - # @!attribute [rw] node_group_config - # @return [::Google::Cloud::Dataproc::V1::InstanceGroupConfig] - # Optional. The node group instance group configuration. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Node group labels. - # - # * Label **keys** must consist of from 1 to 63 characters and conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # * Label **values** can be empty. If specified, they must consist of from - # 1 to 63 characters and conform to [RFC 1035] - # (https://www.ietf.org/rfc/rfc1035.txt). - # * The node group must have no more than 32 labels. - class NodeGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Node pool roles. - module Role - # Required unspecified role. - ROLE_UNSPECIFIED = 0 - - # Job drivers run on the node pool. - DRIVER = 1 - end - end - - # Specifies an executable to run on a fully configured node and a - # timeout period for executable completion. - # @!attribute [rw] executable_file - # @return [::String] - # Required. Cloud Storage URI of executable file. - # @!attribute [rw] execution_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Amount of time executable has to complete. Default is - # 10 minutes (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Cluster creation fails with an explanatory error message (the - # name of the executable that caused the error and the exceeded timeout - # period) if the executable is not completed at end of the timeout period. - class NodeInitializationAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The status of a cluster and its instances. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::ClusterStatus::State] - # Output only. The cluster's state. - # @!attribute [r] detail - # @return [::String] - # Optional. Output only. Details of cluster's state. - # @!attribute [r] state_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this state was entered (see JSON representation of - # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # @!attribute [r] substate - # @return [::Google::Cloud::Dataproc::V1::ClusterStatus::Substate] - # Output only. Additional state information that includes - # status reported by the agent. - class ClusterStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The cluster state. - module State - # The cluster state is unknown. - UNKNOWN = 0 - - # The cluster is being created and set up. It is not ready for use. - CREATING = 1 - - # The cluster is currently running and healthy. It is ready for use. - # - # **Note:** The cluster state changes from "creating" to "running" status - # after the master node(s), first two primary worker nodes (and the last - # primary worker node if primary workers > 2) are running. - RUNNING = 2 - - # The cluster encountered an error. It is not ready for use. - ERROR = 3 - - # The cluster has encountered an error while being updated. Jobs can - # be submitted to the cluster, but the cluster cannot be updated. - ERROR_DUE_TO_UPDATE = 9 - - # The cluster is being deleted. It cannot be used. - DELETING = 4 - - # The cluster is being updated. It continues to accept and process jobs. - UPDATING = 5 - - # The cluster is being stopped. It cannot be used. - STOPPING = 6 - - # The cluster is currently stopped. It is not ready for use. - STOPPED = 7 - - # The cluster is being started. It is not ready for use. - STARTING = 8 - - # The cluster is being repaired. It is not ready for use. - REPAIRING = 10 - end - - # The cluster substate. - module Substate - # The cluster substate is unknown. - UNSPECIFIED = 0 - - # The cluster is known to be in an unhealthy state - # (for example, critical daemons are not running or HDFS capacity is - # exhausted). - # - # Applies to RUNNING state. - UNHEALTHY = 1 - - # The agent-reported status is out of date (may occur if - # Dataproc loses communication with Agent). - # - # Applies to RUNNING state. - STALE_STATUS = 2 - end - end - - # Security related configuration, including encryption, Kerberos, etc. - # @!attribute [rw] kerberos_config - # @return [::Google::Cloud::Dataproc::V1::KerberosConfig] - # Optional. Kerberos related configuration. - # @!attribute [rw] identity_config - # @return [::Google::Cloud::Dataproc::V1::IdentityConfig] - # Optional. Identity related configuration, including service account based - # secure multi-tenancy user mappings. - class SecurityConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies Kerberos related configuration. - # @!attribute [rw] enable_kerberos - # @return [::Boolean] - # Optional. Flag to indicate whether to Kerberize the cluster (default: - # false). Set this field to true to enable Kerberos on a cluster. - # @!attribute [rw] root_principal_password_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the root - # principal password. - # @!attribute [rw] kms_key_uri - # @return [::String] - # Optional. The uri of the KMS key used to encrypt various sensitive - # files. - # @!attribute [rw] keystore_uri - # @return [::String] - # Optional. The Cloud Storage URI of the keystore file used for SSL - # encryption. If not provided, Dataproc will provide a self-signed - # certificate. - # @!attribute [rw] truststore_uri - # @return [::String] - # Optional. The Cloud Storage URI of the truststore file used for SSL - # encryption. If not provided, Dataproc will provide a self-signed - # certificate. - # @!attribute [rw] keystore_password_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the - # password to the user provided keystore. For the self-signed certificate, - # this password is generated by Dataproc. - # @!attribute [rw] key_password_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the - # password to the user provided key. For the self-signed certificate, this - # password is generated by Dataproc. - # @!attribute [rw] truststore_password_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the - # password to the user provided truststore. For the self-signed certificate, - # this password is generated by Dataproc. - # @!attribute [rw] cross_realm_trust_realm - # @return [::String] - # Optional. The remote realm the Dataproc on-cluster KDC will trust, should - # the user enable cross realm trust. - # @!attribute [rw] cross_realm_trust_kdc - # @return [::String] - # Optional. The KDC (IP or hostname) for the remote trusted realm in a cross - # realm trust relationship. - # @!attribute [rw] cross_realm_trust_admin_server - # @return [::String] - # Optional. The admin server (IP or hostname) for the remote trusted realm in - # a cross realm trust relationship. - # @!attribute [rw] cross_realm_trust_shared_password_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the - # shared password between the on-cluster Kerberos realm and the remote - # trusted realm, in a cross realm trust relationship. - # @!attribute [rw] kdc_db_key_uri - # @return [::String] - # Optional. The Cloud Storage URI of a KMS encrypted file containing the - # master key of the KDC database. - # @!attribute [rw] tgt_lifetime_hours - # @return [::Integer] - # Optional. The lifetime of the ticket granting ticket, in hours. - # If not specified, or user specifies 0, then default value 10 - # will be used. - # @!attribute [rw] realm - # @return [::String] - # Optional. The name of the on-cluster Kerberos realm. - # If not specified, the uppercased domain of hostnames will be the realm. - class KerberosConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identity related configuration, including service account based - # secure multi-tenancy user mappings. - # @!attribute [rw] user_service_account_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Required. Map of user to service account. - class IdentityConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserServiceAccountMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Specifies the selection and config of software inside the cluster. - # @!attribute [rw] image_version - # @return [::String] - # Optional. The version of software inside the cluster. It must be one of the - # supported [Dataproc - # Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions), - # such as "1.2" (including a subminor version, such as "1.2.29"), or the - # ["preview" - # version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). - # If unspecified, it defaults to the latest Debian version. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The properties to set on daemon config files. - # - # Property keys are specified in `prefix:property` format, for example - # `core:hadoop.tmp.dir`. The following are supported prefixes - # and their mappings: - # - # * capacity-scheduler: `capacity-scheduler.xml` - # * core: `core-site.xml` - # * distcp: `distcp-default.xml` - # * hdfs: `hdfs-site.xml` - # * hive: `hive-site.xml` - # * mapred: `mapred-site.xml` - # * pig: `pig.properties` - # * spark: `spark-defaults.conf` - # * yarn: `yarn-site.xml` - # - # For more information, see [Cluster - # properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). - # @!attribute [rw] optional_components - # @return [::Array<::Google::Cloud::Dataproc::V1::Component>] - # Optional. The set of components to activate on the cluster. - class SoftwareConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Specifies the cluster auto-delete schedule configuration. - # @!attribute [rw] idle_delete_ttl - # @return [::Google::Protobuf::Duration] - # Optional. The duration to keep the cluster alive while idling (when no jobs - # are running). Passing this threshold will cause the cluster to be - # deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON - # representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # @!attribute [rw] auto_delete_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time when cluster will be auto-deleted (see JSON - # representation of - # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # @!attribute [rw] auto_delete_ttl - # @return [::Google::Protobuf::Duration] - # Optional. The lifetime duration of cluster. The cluster will be - # auto-deleted at the end of this period. Minimum value is 10 minutes; - # maximum value is 14 days (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # @!attribute [r] idle_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when cluster became idle (most recent job finished) - # and became eligible for deletion due to idleness (see JSON representation - # of - # [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - class LifecycleConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies a Metastore configuration. - # @!attribute [rw] dataproc_metastore_service - # @return [::String] - # Required. Resource name of an existing Dataproc Metastore service. - # - # Example: - # - # * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]` - class MetastoreConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains cluster daemon metrics, such as HDFS and YARN stats. - # - # **Beta Feature**: This report is available for testing purposes only. It may - # be changed before final release. - # @!attribute [rw] hdfs_metrics - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # The HDFS metrics. - # @!attribute [rw] yarn_metrics - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # YARN metrics. - class ClusterMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class HdfsMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class YarnMetricsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Dataproc metric config. - # @!attribute [rw] metrics - # @return [::Array<::Google::Cloud::Dataproc::V1::DataprocMetricConfig::Metric>] - # Required. Metrics sources to enable. - class DataprocMetricConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A Dataproc custom metric. - # @!attribute [rw] metric_source - # @return [::Google::Cloud::Dataproc::V1::DataprocMetricConfig::MetricSource] - # Required. A standard set of metrics is collected unless `metricOverrides` - # are specified for the metric source (see [Custom metrics] - # (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) - # for more information). - # @!attribute [rw] metric_overrides - # @return [::Array<::String>] - # Optional. Specify one or more [Custom metrics] - # (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) - # to collect for the metric course (for the `SPARK` metric source (any - # [Spark metric] - # (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be - # specified). - # - # Provide metrics in the following format: - # METRIC_SOURCE:INSTANCE:GROUP:METRIC - # Use camelcase as appropriate. - # - # Examples: - # - # ``` - # yarn:ResourceManager:QueueMetrics:AppsCompleted - # spark:driver:DAGScheduler:job.allJobs - # sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed - # hiveserver2:JVM:Memory:NonHeapMemoryUsage.used - # ``` - # - # Notes: - # - # * Only the specified overridden metrics are collected for the - # metric source. For example, if one or more `spark:executive` metrics - # are listed as metric overrides, other `SPARK` metrics are not - # collected. The collection of the metrics for other enabled custom - # metric sources is unaffected. For example, if both `SPARK` andd `YARN` - # metric sources are enabled, and overrides are provided for Spark - # metrics only, all YARN metrics are collected. - class Metric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A source for the collection of Dataproc custom metrics (see [Custom - # metrics] - # (https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics)). - module MetricSource - # Required unspecified metric source. - METRIC_SOURCE_UNSPECIFIED = 0 - - # Monitoring agent metrics. If this source is enabled, - # Dataproc enables the monitoring agent in Compute Engine, - # and collects monitoring agent metrics, which are published - # with an `agent.googleapis.com` prefix. - MONITORING_AGENT_DEFAULTS = 1 - - # HDFS metric source. - HDFS = 2 - - # Spark metric source. - SPARK = 3 - - # YARN metric source. - YARN = 4 - - # Spark History Server metric source. - SPARK_HISTORY_SERVER = 5 - - # Hiveserver2 metric source. - HIVESERVER2 = 6 - - # hivemetastore metric source - HIVEMETASTORE = 7 - end - end - - # A request to create a cluster. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster - # @return [::Google::Cloud::Dataproc::V1::Cluster] - # Required. The cluster to create. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @!attribute [rw] action_on_failed_primary_workers - # @return [::Google::Cloud::Dataproc::V1::FailureAction] - # Optional. Failure action when primary worker creation fails. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to update a cluster. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - # @!attribute [rw] cluster - # @return [::Google::Cloud::Dataproc::V1::Cluster] - # Required. The changes to the cluster. - # @!attribute [rw] graceful_decommission_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Timeout for graceful YARN decommissioning. Graceful - # decommissioning allows removing nodes from the cluster without - # interrupting jobs in progress. Timeout specifies how long to wait for jobs - # in progress to finish before forcefully removing nodes (and potentially - # interrupting jobs). Default timeout is 0 (for forceful decommission), and - # the maximum allowed timeout is 1 day. (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the path, relative to `Cluster`, of - # the field to update. For example, to change the number of workers - # in a cluster to 5, the `update_mask` parameter would be - # specified as `config.worker_config.num_instances`, - # and the `PATCH` request body would specify the new value, as follows: - # - # { - # "config":{ - # "workerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Similarly, to change the number of preemptible workers in a cluster to 5, - # the `update_mask` parameter would be - # `config.secondary_worker_config.num_instances`, and the `PATCH` request - # body would be set as follows: - # - # { - # "config":{ - # "secondaryWorkerConfig":{ - # "numInstances":"5" - # } - # } - # } - # Note: Currently, only the following fields can be updated: - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - # - #
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - # change autoscaling policies
- # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to stop a cluster. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - # @!attribute [rw] cluster_uuid - # @return [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class StopClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to start a cluster. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project the - # cluster belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - # @!attribute [rw] cluster_uuid - # @return [::String] - # Optional. Specifying the `cluster_uuid` means the RPC will fail - # (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class StartClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a cluster. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - # @!attribute [rw] cluster_uuid - # @return [::String] - # Optional. Specifying the `cluster_uuid` means the RPC should fail - # (with error NOT_FOUND) if cluster with specified UUID does not exist. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server - # receives two - # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to get the resource representation for a cluster in a project. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list the clusters in a project. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter constraining the clusters to list. Filters are - # case-sensitive and have the following syntax: - # - # field = value [AND [field = value]] ... - # - # where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - # and `[KEY]` is a label key. **value** can be `*` to match all values. - # `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - # `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` - # contains the `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` - # contains the `DELETING` and `ERROR` states. - # `clusterName` is the name of the cluster provided at creation time. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND clusterName = mycluster - # AND labels.env = staging AND labels.starred = * - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The standard List page size. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The standard List page token. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The list of all clusters in a project. - # @!attribute [r] clusters - # @return [::Array<::Google::Cloud::Dataproc::V1::Cluster>] - # Output only. The clusters in the project. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. This token is included in the response if there are more - # results to fetch. To fetch additional results, provide this value as the - # `page_token` in a subsequent `ListClustersRequest`. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to collect cluster diagnostic information. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the cluster - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name. - # @!attribute [rw] tarball_gcs_dir - # @return [::String] - # Optional. The output Cloud Storage directory for the diagnostic - # tarball. If not specified, a task-specific directory in the cluster's - # staging bucket will be used. - # @!attribute [rw] tarball_access - # @return [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess] - # Optional. (Optional) The access type to the diagnostic tarball. If not - # specified, falls back to default access of the bucket - # @!attribute [rw] diagnosis_interval - # @return [::Google::Type::Interval] - # Optional. Time interval in which diagnosis should be carried out on the - # cluster. - # @!attribute [rw] jobs - # @return [::Array<::String>] - # Optional. Specifies a list of jobs on which diagnosis is to be performed. - # Format: projects/\\{project}/regions/\\{region}/jobs/\\{job} - # @!attribute [rw] yarn_application_ids - # @return [::Array<::String>] - # Optional. Specifies a list of yarn applications on which diagnosis is to be - # performed. - class DiagnoseClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines who has access to the diagnostic tarball - module TarballAccess - # Tarball Access unspecified. Falls back to default access of the bucket - TARBALL_ACCESS_UNSPECIFIED = 0 - - # Google Cloud Support group has read access to the - # diagnostic tarball - GOOGLE_CLOUD_SUPPORT = 1 - - # Google Cloud Dataproc Diagnose service account has read access to the - # diagnostic tarball - GOOGLE_DATAPROC_DIAGNOSE = 2 - end - end - - # The location of diagnostic output. - # @!attribute [r] output_uri - # @return [::String] - # Output only. The Cloud Storage URI of the diagnostic output. - # The output report is a plain text file with a summary of collected - # diagnostics. - class DiagnoseClusterResults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Reservation Affinity for consuming Zonal reservation. - # @!attribute [rw] consume_reservation_type - # @return [::Google::Cloud::Dataproc::V1::ReservationAffinity::Type] - # Optional. Type of reservation to consume - # @!attribute [rw] key - # @return [::String] - # Optional. Corresponds to the label key of reservation resource. - # @!attribute [rw] values - # @return [::Array<::String>] - # Optional. Corresponds to the label values of reservation resource. - class ReservationAffinity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicates whether to consume capacity from an reservation or not. - module Type - TYPE_UNSPECIFIED = 0 - - # Do not consume from any allocated capacity. - NO_RESERVATION = 1 - - # Consume any reservation available. - ANY_RESERVATION = 2 - - # Must consume from a specific reservation. Must specify key value fields - # for specifying the reservations. - SPECIFIC_RESERVATION = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb deleted file mode 100644 index 09667b29f9ef..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/jobs.rb +++ /dev/null @@ -1,1073 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # The runtime logging config of the job. - # @!attribute [rw] driver_log_levels - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dataproc::V1::LoggingConfig::Level}] - # The per-package log levels for the driver. This may include - # "root" package name to configure rootLogger. - # Examples: - # - 'com.google = FATAL' - # - 'root = INFO' - # - 'org.apache = DEBUG' - class LoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig::Level] - class DriverLogLevelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Log4j level for job execution. When running an - # [Apache Hive](https://hive.apache.org/) job, Cloud - # Dataproc configures the Hive client to an equivalent verbosity level. - module Level - # Level is unspecified. Use default level for log4j. - LEVEL_UNSPECIFIED = 0 - - # Use ALL level for log4j. - ALL = 1 - - # Use TRACE level for log4j. - TRACE = 2 - - # Use DEBUG level for log4j. - DEBUG = 3 - - # Use INFO level for log4j. - INFO = 4 - - # Use WARN level for log4j. - WARN = 5 - - # Use ERROR level for log4j. - ERROR = 6 - - # Use FATAL level for log4j. - FATAL = 7 - - # Turn off log4j. - OFF = 8 - end - end - - # A Dataproc job for running - # [Apache Hadoop - # MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) - # jobs on [Apache Hadoop - # YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). - # @!attribute [rw] main_jar_file_uri - # @return [::String] - # The HCFS URI of the jar file containing the main class. - # Examples: - # 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' - # 'hdfs:/tmp/test-samples/custom-wordcount.jar' - # 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' - # @!attribute [rw] main_class - # @return [::String] - # The name of the driver's main class. The jar file containing the class - # must be in the default CLASSPATH or specified in `jar_file_uris`. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not - # include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as - # job properties, since a collision may occur that causes an incorrect job - # submission. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. Jar file URIs to add to the CLASSPATHs of the - # Hadoop driver and tasks. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied - # to the working directory of Hadoop drivers and distributed tasks. Useful - # for naively parallel tasks. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted in the working directory of - # Hadoop drivers and tasks. Supported file types: - # .jar, .tar, .tar.gz, .tgz, or .zip. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure Hadoop. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and - # classes in user code. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class HadoopJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running [Apache Spark](https://spark.apache.org/) - # applications on YARN. - # @!attribute [rw] main_jar_file_uri - # @return [::String] - # The HCFS URI of the jar file that contains the main class. - # @!attribute [rw] main_class - # @return [::String] - # The name of the driver's main class. The jar file that contains the class - # must be in the default CLASSPATH or specified in `jar_file_uris`. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not include arguments, - # such as `--conf`, that can be set as job properties, since a collision may - # occur that causes an incorrect job submission. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the CLASSPATHs of the - # Spark driver and tasks. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. Useful for naively parallel tasks. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # .jar, .tar, .tar.gz, .tgz, and .zip. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure Spark. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in - # /etc/spark/conf/spark-defaults.conf and classes in user code. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class SparkJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running - # [Apache - # PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) - # applications on YARN. - # @!attribute [rw] main_python_file_uri - # @return [::String] - # Required. The HCFS URI of the main Python file to use as the driver. Must - # be a .py file. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not include arguments, - # such as `--conf`, that can be set as job properties, since a collision may - # occur that causes an incorrect job submission. - # @!attribute [rw] python_file_uris - # @return [::Array<::String>] - # Optional. HCFS file URIs of Python files to pass to the PySpark - # framework. Supported file types: .py, .egg, and .zip. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the CLASSPATHs of the - # Python driver and tasks. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. Useful for naively parallel tasks. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # .jar, .tar, .tar.gz, .tgz, and .zip. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure PySpark. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in - # /etc/spark/conf/spark-defaults.conf and classes in user code. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class PySparkJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A list of queries to run on a cluster. - # @!attribute [rw] queries - # @return [::Array<::String>] - # Required. The queries to execute. You do not need to end a query expression - # with a semicolon. Multiple queries can be specified in one - # string by separating each with a semicolon. Here is an example of a - # Dataproc API snippet that uses a QueryList to specify a HiveJob: - # - # "hiveJob": { - # "queryList": { - # "queries": [ - # "query1", - # "query2", - # "query3;query4", - # ] - # } - # } - class QueryList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Dataproc job for running [Apache Hive](https://hive.apache.org/) - # queries on YARN. - # @!attribute [rw] query_file_uri - # @return [::String] - # The HCFS URI of the script that contains Hive queries. - # @!attribute [rw] query_list - # @return [::Google::Cloud::Dataproc::V1::QueryList] - # A list of queries. - # @!attribute [rw] continue_on_failure - # @return [::Boolean] - # Optional. Whether to continue executing queries if a query fails. - # The default value is `false`. Setting to `true` can be useful when - # executing independent parallel queries. - # @!attribute [rw] script_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Mapping of query variable names to values (equivalent to the - # Hive command: `SET name="value";`). - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names and values, used to configure Hive. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, - # /etc/hive/conf/hive-site.xml, and classes in user code. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the CLASSPATH of the - # Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes - # and UDFs. - class HiveJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ScriptVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running [Apache Spark - # SQL](https://spark.apache.org/sql/) queries. - # @!attribute [rw] query_file_uri - # @return [::String] - # The HCFS URI of the script that contains SQL queries. - # @!attribute [rw] query_list - # @return [::Google::Cloud::Dataproc::V1::QueryList] - # A list of queries. - # @!attribute [rw] script_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Mapping of query variable names to values (equivalent to the - # Spark SQL command: SET `name="value";`). - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure - # Spark SQL's SparkConf. Properties that conflict with values set by the - # Dataproc API may be overwritten. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class SparkSqlJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ScriptVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running [Apache Pig](https://pig.apache.org/) - # queries on YARN. - # @!attribute [rw] query_file_uri - # @return [::String] - # The HCFS URI of the script that contains the Pig queries. - # @!attribute [rw] query_list - # @return [::Google::Cloud::Dataproc::V1::QueryList] - # A list of queries. - # @!attribute [rw] continue_on_failure - # @return [::Boolean] - # Optional. Whether to continue executing queries if a query fails. - # The default value is `false`. Setting to `true` can be useful when - # executing independent parallel queries. - # @!attribute [rw] script_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Mapping of query variable names to values (equivalent to the Pig - # command: `name=[value]`). - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure Pig. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, - # /etc/pig/conf/pig.properties, and classes in user code. - # @!attribute [rw] jar_file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of jar files to add to the CLASSPATH of - # the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class PigJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ScriptVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running - # [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) - # applications on YARN. - # @!attribute [rw] main_r_file_uri - # @return [::String] - # Required. The HCFS URI of the main R file to use as the driver. - # Must be a .R file. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. The arguments to pass to the driver. Do not include arguments, - # such as `--conf`, that can be set as job properties, since a collision may - # occur that causes an incorrect job submission. - # @!attribute [rw] file_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of files to be placed in the working directory of - # each executor. Useful for naively parallel tasks. - # @!attribute [rw] archive_uris - # @return [::Array<::String>] - # Optional. HCFS URIs of archives to be extracted into the working directory - # of each executor. Supported file types: - # .jar, .tar, .tar.gz, .tgz, and .zip. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, used to configure SparkR. - # Properties that conflict with values set by the Dataproc API may be - # overwritten. Can include properties set in - # /etc/spark/conf/spark-defaults.conf and classes in user code. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class SparkRJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running [Presto](https://prestosql.io/) queries. - # **IMPORTANT**: The [Dataproc Presto Optional - # Component](https://cloud.google.com/dataproc/docs/concepts/components/presto) - # must be enabled when the cluster is created to submit a Presto job to the - # cluster. - # @!attribute [rw] query_file_uri - # @return [::String] - # The HCFS URI of the script that contains SQL queries. - # @!attribute [rw] query_list - # @return [::Google::Cloud::Dataproc::V1::QueryList] - # A list of queries. - # @!attribute [rw] continue_on_failure - # @return [::Boolean] - # Optional. Whether to continue executing queries if a query fails. - # The default value is `false`. Setting to `true` can be useful when - # executing independent parallel queries. - # @!attribute [rw] output_format - # @return [::String] - # Optional. The format in which query output will be displayed. See the - # Presto documentation for supported output formats - # @!attribute [rw] client_tags - # @return [::Array<::String>] - # Optional. Presto client tags to attach to this query - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values. Used to set Presto - # [session properties](https://prestodb.io/docs/current/sql/set-session.html) - # Equivalent to using the --session flag in the Presto CLI - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class PrestoJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Dataproc job for running [Trino](https://trino.io/) queries. - # **IMPORTANT**: The [Dataproc Trino Optional - # Component](https://cloud.google.com/dataproc/docs/concepts/components/trino) - # must be enabled when the cluster is created to submit a Trino job to the - # cluster. - # @!attribute [rw] query_file_uri - # @return [::String] - # The HCFS URI of the script that contains SQL queries. - # @!attribute [rw] query_list - # @return [::Google::Cloud::Dataproc::V1::QueryList] - # A list of queries. - # @!attribute [rw] continue_on_failure - # @return [::Boolean] - # Optional. Whether to continue executing queries if a query fails. - # The default value is `false`. Setting to `true` can be useful when - # executing independent parallel queries. - # @!attribute [rw] output_format - # @return [::String] - # Optional. The format in which query output will be displayed. See the - # Trino documentation for supported output formats - # @!attribute [rw] client_tags - # @return [::Array<::String>] - # Optional. Trino client tags to attach to this query - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values. Used to set Trino - # [session properties](https://trino.io/docs/current/sql/set-session.html) - # Equivalent to using the --session flag in the Trino CLI - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dataproc::V1::LoggingConfig] - # Optional. The runtime log config for job execution. - class TrinoJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Dataproc job config. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The name of the cluster where the job will be submitted. - # @!attribute [r] cluster_uuid - # @return [::String] - # Output only. A cluster UUID generated by the Dataproc service when - # the job is submitted. - # @!attribute [rw] cluster_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Cluster labels to identify a cluster where the job will be - # submitted. - class JobPlacement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ClusterLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Dataproc job status. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::JobStatus::State] - # Output only. A state message specifying the overall job state. - # @!attribute [r] details - # @return [::String] - # Optional. Output only. Job state details, such as an error - # description if the state is ERROR. - # @!attribute [r] state_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when this state was entered. - # @!attribute [r] substate - # @return [::Google::Cloud::Dataproc::V1::JobStatus::Substate] - # Output only. Additional state information, which includes - # status reported by the agent. - class JobStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The job state. - module State - # The job state is unknown. - STATE_UNSPECIFIED = 0 - - # The job is pending; it has been submitted, but is not yet running. - PENDING = 1 - - # Job has been received by the service and completed initial setup; - # it will soon be submitted to the cluster. - SETUP_DONE = 8 - - # The job is running on the cluster. - RUNNING = 2 - - # A CancelJob request has been received, but is pending. - CANCEL_PENDING = 3 - - # Transient in-flight resources have been canceled, and the request to - # cancel the running job has been issued to the cluster. - CANCEL_STARTED = 7 - - # The job cancellation was successful. - CANCELLED = 4 - - # The job has completed successfully. - DONE = 5 - - # The job has completed, but encountered an error. - ERROR = 6 - - # Job attempt has failed. The detail field contains failure details for - # this attempt. - # - # Applies to restartable jobs only. - ATTEMPT_FAILURE = 9 - end - - # The job substate. - module Substate - # The job substate is unknown. - UNSPECIFIED = 0 - - # The Job is submitted to the agent. - # - # Applies to RUNNING state. - SUBMITTED = 1 - - # The Job has been received and is awaiting execution (it may be waiting - # for a condition to be met). See the "details" field for the reason for - # the delay. - # - # Applies to RUNNING state. - QUEUED = 2 - - # The agent-reported status is out of date, which may be caused by a - # loss of communication between the agent and Dataproc. If the - # agent does not send a timely update, the job will fail. - # - # Applies to RUNNING state. - STALE_STATUS = 3 - end - end - - # Encapsulates the full scoping used to reference a job. - # @!attribute [rw] project_id - # @return [::String] - # Optional. The ID of the Google Cloud Platform project that the job belongs - # to. If specified, must match the request project ID. - # @!attribute [rw] job_id - # @return [::String] - # Optional. The job ID, which must be unique within the project. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), or hyphens (-). The maximum length is 100 characters. - # - # If not specified by the caller, the job ID will be provided by the server. - class JobReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A YARN application created by a job. Application information is a subset of - # org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto. - # - # **Beta Feature**: This report is available for testing purposes only. It may - # be changed before final release. - # @!attribute [rw] name - # @return [::String] - # Required. The application name. - # @!attribute [rw] state - # @return [::Google::Cloud::Dataproc::V1::YarnApplication::State] - # Required. The application state. - # @!attribute [rw] progress - # @return [::Float] - # Required. The numerical progress of the application, from 1 to 100. - # @!attribute [rw] tracking_url - # @return [::String] - # Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or - # TimelineServer that provides application-specific information. The URL uses - # the internal hostname, and requires a proxy server for resolution and, - # possibly, access. - class YarnApplication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The application state, corresponding to - # YarnProtos.YarnApplicationStateProto. - module State - # Status is unspecified. - STATE_UNSPECIFIED = 0 - - # Status is NEW. - NEW = 1 - - # Status is NEW_SAVING. - NEW_SAVING = 2 - - # Status is SUBMITTED. - SUBMITTED = 3 - - # Status is ACCEPTED. - ACCEPTED = 4 - - # Status is RUNNING. - RUNNING = 5 - - # Status is FINISHED. - FINISHED = 6 - - # Status is FAILED. - FAILED = 7 - - # Status is KILLED. - KILLED = 8 - end - end - - # A Dataproc job resource. - # @!attribute [rw] reference - # @return [::Google::Cloud::Dataproc::V1::JobReference] - # Optional. The fully qualified reference to the job, which can be used to - # obtain the equivalent REST path of the job resource. If this property - # is not specified when a job is created, the server generates a - # job_id. - # @!attribute [rw] placement - # @return [::Google::Cloud::Dataproc::V1::JobPlacement] - # Required. Job information, including how, when, and where to - # run the job. - # @!attribute [rw] hadoop_job - # @return [::Google::Cloud::Dataproc::V1::HadoopJob] - # Optional. Job is a Hadoop job. - # @!attribute [rw] spark_job - # @return [::Google::Cloud::Dataproc::V1::SparkJob] - # Optional. Job is a Spark job. - # @!attribute [rw] pyspark_job - # @return [::Google::Cloud::Dataproc::V1::PySparkJob] - # Optional. Job is a PySpark job. - # @!attribute [rw] hive_job - # @return [::Google::Cloud::Dataproc::V1::HiveJob] - # Optional. Job is a Hive job. - # @!attribute [rw] pig_job - # @return [::Google::Cloud::Dataproc::V1::PigJob] - # Optional. Job is a Pig job. - # @!attribute [rw] spark_r_job - # @return [::Google::Cloud::Dataproc::V1::SparkRJob] - # Optional. Job is a SparkR job. - # @!attribute [rw] spark_sql_job - # @return [::Google::Cloud::Dataproc::V1::SparkSqlJob] - # Optional. Job is a SparkSql job. - # @!attribute [rw] presto_job - # @return [::Google::Cloud::Dataproc::V1::PrestoJob] - # Optional. Job is a Presto job. - # @!attribute [rw] trino_job - # @return [::Google::Cloud::Dataproc::V1::TrinoJob] - # Optional. Job is a Trino job. - # @!attribute [r] status - # @return [::Google::Cloud::Dataproc::V1::JobStatus] - # Output only. The job status. Additional application-specific - # status information may be contained in the type_job - # and yarn_applications fields. - # @!attribute [r] status_history - # @return [::Array<::Google::Cloud::Dataproc::V1::JobStatus>] - # Output only. The previous job status. - # @!attribute [r] yarn_applications - # @return [::Array<::Google::Cloud::Dataproc::V1::YarnApplication>] - # Output only. The collection of YARN applications spun up by this job. - # - # **Beta** Feature: This report is available for testing purposes only. It - # may be changed before final release. - # @!attribute [r] driver_output_resource_uri - # @return [::String] - # Output only. A URI pointing to the location of the stdout of the job's - # driver program. - # @!attribute [r] driver_control_files_uri - # @return [::String] - # Output only. If present, the location of miscellaneous control files - # which may be used as part of job setup and handling. If not present, - # control files may be placed in the same location as `driver_output_uri`. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this job. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with a job. - # @!attribute [rw] scheduling - # @return [::Google::Cloud::Dataproc::V1::JobScheduling] - # Optional. Job scheduling configuration. - # @!attribute [r] job_uuid - # @return [::String] - # Output only. A UUID that uniquely identifies a job within the project - # over time. This is in contrast to a user-settable reference.job_id that - # may be reused over time. - # @!attribute [r] done - # @return [::Boolean] - # Output only. Indicates whether the job is completed. If the value is - # `false`, the job is still in progress. If `true`, the job is completed, and - # `status.state` field will indicate if it was successful, failed, - # or cancelled. - # @!attribute [rw] driver_scheduling_config - # @return [::Google::Cloud::Dataproc::V1::DriverSchedulingConfig] - # Optional. Driver scheduling configuration. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Driver scheduling configuration. - # @!attribute [rw] memory_mb - # @return [::Integer] - # Required. The amount of memory in MB the driver is requesting. - # @!attribute [rw] vcores - # @return [::Integer] - # Required. The number of vCPUs the driver is requesting. - class DriverSchedulingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Job scheduling options. - # @!attribute [rw] max_failures_per_hour - # @return [::Integer] - # Optional. Maximum number of times per hour a driver may be restarted as - # a result of driver exiting with non-zero code before job is - # reported failed. - # - # A job may be reported as thrashing if the driver exits with a non-zero code - # four times within a 10-minute window. - # - # Maximum value is 10. - # - # **Note:** This restartable job option is not supported in Dataproc - # [workflow templates] - # (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). - # @!attribute [rw] max_failures_total - # @return [::Integer] - # Optional. Maximum total number of times a driver may be restarted as a - # result of the driver exiting with a non-zero code. After the maximum number - # is reached, the job will be reported as failed. - # - # Maximum value is 240. - # - # **Note:** Currently, this restartable job option is - # not supported in Dataproc - # [workflow - # templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). - class JobScheduling - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to submit a job. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] job - # @return [::Google::Cloud::Dataproc::V1::Job] - # Required. The job resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique id used to identify the request. If the server - # receives two - # [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - # with the same id, then the second request will be ignored and the - # first {::Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend - # is returned. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class SubmitJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Job Operation metadata. - # @!attribute [r] job_id - # @return [::String] - # Output only. The job id. - # @!attribute [r] status - # @return [::Google::Cloud::Dataproc::V1::JobStatus] - # Output only. Most recent job status. - # @!attribute [r] operation_type - # @return [::String] - # Output only. Operation type. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Job submission time. - class JobMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get the resource representation for a job in a project. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] job_id - # @return [::String] - # Required. The job ID. - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list jobs in a project. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The number of results to return in each response. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - # @!attribute [rw] cluster_name - # @return [::String] - # Optional. If set, the returned jobs list includes only jobs that were - # submitted to the named cluster. - # @!attribute [rw] job_state_matcher - # @return [::Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher] - # Optional. Specifies enumerated categories of jobs to list. - # (default = match ALL jobs). - # - # If `filter` is provided, `jobStateMatcher` will be ignored. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter constraining the jobs to list. Filters are - # case-sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - # - # where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - # key. **value** can be `*` to match all values. - # `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - # Only the logical `AND` operator is supported; space-separated items are - # treated as having an implicit `AND` operator. - # - # Example filter: - # - # status.state = ACTIVE AND labels.env = staging AND labels.starred = * - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A matcher that specifies categories of job states. - module JobStateMatcher - # Match all jobs, regardless of state. - ALL = 0 - - # Only match jobs in non-terminal states: PENDING, RUNNING, or - # CANCEL_PENDING. - ACTIVE = 1 - - # Only match jobs in terminal states: CANCELLED, DONE, or ERROR. - NON_ACTIVE = 2 - end - end - - # A request to update a job. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] job_id - # @return [::String] - # Required. The job ID. - # @!attribute [rw] job - # @return [::Google::Cloud::Dataproc::V1::Job] - # Required. The changes to the job. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the path, relative to Job, of - # the field to update. For example, to update the labels of a Job the - # update_mask parameter would be specified as - # labels, and the `PATCH` request body would specify the new - # value. Note: Currently, labels is the only - # field that can be updated. - class UpdateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of jobs in a project. - # @!attribute [r] jobs - # @return [::Array<::Google::Cloud::Dataproc::V1::Job>] - # Output only. Jobs list. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. This token is included in the response if there are more results - # to fetch. To fetch additional results, provide this value as the - # `page_token` in a subsequent ListJobsRequest. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to cancel a job. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] job_id - # @return [::String] - # Required. The job ID. - class CancelJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a job. - # @!attribute [rw] project_id - # @return [::String] - # Required. The ID of the Google Cloud Platform project that the job - # belongs to. - # @!attribute [rw] region - # @return [::String] - # Required. The Dataproc region in which to handle the request. - # @!attribute [rw] job_id - # @return [::String] - # Required. The job ID. - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb deleted file mode 100644 index 092822819fdb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/node_groups.rb +++ /dev/null @@ -1,115 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # A request to create a node group. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this node group will be created. - # Format: `projects/{project}/regions/{region}/clusters/{cluster}` - # @!attribute [rw] node_group - # @return [::Google::Cloud::Dataproc::V1::NodeGroup] - # Required. The node group to create. - # @!attribute [rw] node_group_id - # @return [::String] - # Optional. An optional node group ID. Generated if not specified. - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of from 3 to 33 characters. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class CreateNodeGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to resize a node group. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the node group to resize. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - # @!attribute [rw] size - # @return [::Integer] - # Required. The number of running instances for the node group to maintain. - # The group adds or removes instances to maintain the number of instances - # specified by this parameter. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the server receives - # two - # [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - # with the same ID, the second request is ignored and the - # first {::Google::Longrunning::Operation google.longrunning.Operation} created - # and stored in the backend is returned. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The ID must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @!attribute [rw] graceful_decommission_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Timeout for graceful YARN decommissioning. [Graceful - # decommissioning] - # (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - # allows the removal of nodes from the Compute Engine node group - # without interrupting jobs in progress. This timeout specifies how long to - # wait for jobs in progress to finish before forcefully removing nodes (and - # potentially interrupting jobs). Default timeout is 0 (for forceful - # decommission), and the maximum allowed timeout is 1 day. (see JSON - # representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # - # Only supported on Dataproc image versions 1.2 and higher. - class ResizeNodeGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get a node group . - # @!attribute [rw] name - # @return [::String] - # Required. The name of the node group to retrieve. - # Format: - # `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - class GetNodeGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb deleted file mode 100644 index 6894c7e8cd86..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/operations.rb +++ /dev/null @@ -1,260 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # Metadata describing the Batch operation. - # @!attribute [rw] batch - # @return [::String] - # Name of the batch for the operation. - # @!attribute [rw] batch_uuid - # @return [::String] - # Batch UUID for the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was created. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - # @!attribute [rw] operation_type - # @return [::Google::Cloud::Dataproc::V1::BatchOperationMetadata::BatchOperationType] - # The operation type. - # @!attribute [rw] description - # @return [::String] - # Short description of the operation. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with the operation. - # @!attribute [rw] warnings - # @return [::Array<::String>] - # Warnings encountered during operation execution. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation type for Batch resources - module BatchOperationType - # Batch operation type is unknown. - BATCH_OPERATION_TYPE_UNSPECIFIED = 0 - - # Batch operation type. - BATCH = 1 - end - end - - # Metadata describing the Session operation. - # @!attribute [rw] session - # @return [::String] - # Name of the session for the operation. - # @!attribute [rw] session_uuid - # @return [::String] - # Session UUID for the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was created. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation was finished. - # @!attribute [rw] operation_type - # @return [::Google::Cloud::Dataproc::V1::SessionOperationMetadata::SessionOperationType] - # The operation type. - # @!attribute [rw] description - # @return [::String] - # Short description of the operation. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with the operation. - # @!attribute [rw] warnings - # @return [::Array<::String>] - # Warnings encountered during operation execution. - class SessionOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation type for Session resources - module SessionOperationType - # Session operation type is unknown. - SESSION_OPERATION_TYPE_UNSPECIFIED = 0 - - # Create Session operation type. - CREATE = 1 - - # Terminate Session operation type. - TERMINATE = 2 - - # Delete Session operation type. - DELETE = 3 - end - end - - # The status of the operation. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus::State] - # Output only. A message containing the operation state. - # @!attribute [r] inner_state - # @return [::String] - # Output only. A message containing the detailed operation state. - # @!attribute [r] details - # @return [::String] - # Output only. A message containing any operation metadata details. - # @!attribute [r] state_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this state was entered. - class ClusterOperationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The operation state. - module State - # Unused. - UNKNOWN = 0 - - # The operation has been created. - PENDING = 1 - - # The operation is running. - RUNNING = 2 - - # The operation is done; either cancelled or completed. - DONE = 3 - end - end - - # Metadata describing the operation. - # @!attribute [r] cluster_name - # @return [::String] - # Output only. Name of the cluster for the operation. - # @!attribute [r] cluster_uuid - # @return [::String] - # Output only. Cluster UUID for the operation. - # @!attribute [r] status - # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus] - # Output only. Current operation status. - # @!attribute [r] status_history - # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterOperationStatus>] - # Output only. The previous operation status. - # @!attribute [r] operation_type - # @return [::String] - # Output only. The operation type. - # @!attribute [r] description - # @return [::String] - # Output only. Short description of operation. - # @!attribute [r] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Labels associated with the operation - # @!attribute [r] warnings - # @return [::Array<::String>] - # Output only. Errors encountered during operation execution. - # @!attribute [r] child_operation_ids - # @return [::Array<::String>] - # Output only. Child operation ids - class ClusterOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Metadata describing the node group operation. - # @!attribute [r] node_group_id - # @return [::String] - # Output only. Node group ID for the operation. - # @!attribute [r] cluster_uuid - # @return [::String] - # Output only. Cluster UUID associated with the node group operation. - # @!attribute [r] status - # @return [::Google::Cloud::Dataproc::V1::ClusterOperationStatus] - # Output only. Current operation status. - # @!attribute [r] status_history - # @return [::Array<::Google::Cloud::Dataproc::V1::ClusterOperationStatus>] - # Output only. The previous operation status. - # @!attribute [rw] operation_type - # @return [::Google::Cloud::Dataproc::V1::NodeGroupOperationMetadata::NodeGroupOperationType] - # The operation type. - # @!attribute [r] description - # @return [::String] - # Output only. Short description of operation. - # @!attribute [r] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Labels associated with the operation. - # @!attribute [r] warnings - # @return [::Array<::String>] - # Output only. Errors encountered during operation execution. - class NodeGroupOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Operation type for node group resources. - module NodeGroupOperationType - # Node group operation type is unknown. - NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0 - - # Create node group operation type. - CREATE = 1 - - # Update node group operation type. - UPDATE = 2 - - # Delete node group operation type. - DELETE = 3 - - # Resize node group operation type. - RESIZE = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb deleted file mode 100644 index 7b77b0c2310c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/session_templates.rb +++ /dev/null @@ -1,153 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # A request to create a session template. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this session template will be created. - # @!attribute [rw] session_template - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # Required. The session template to create. - class CreateSessionTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to update a session template. - # @!attribute [rw] session_template - # @return [::Google::Cloud::Dataproc::V1::SessionTemplate] - # Required. The updated session template. - class UpdateSessionTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get the resource representation for a session template. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session template to retrieve. - class GetSessionTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list session templates in a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent that owns this collection of session templates. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter for the session templates to return in the response. - # Filters are case sensitive and have the following syntax: - # - # [field = value] AND [field [= value]] ... - class ListSessionTemplatesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of session templates. - # @!attribute [r] session_templates - # @return [::Array<::Google::Cloud::Dataproc::V1::SessionTemplate>] - # Output only. Session template list - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListSessionTemplatesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a session template. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session template resource to delete. - class DeleteSessionTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A representation of a session template. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the session template. - # @!attribute [rw] description - # @return [::String] - # Optional. Brief description of the template. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the template was created. - # @!attribute [rw] jupyter_session - # @return [::Google::Cloud::Dataproc::V1::JupyterConfig] - # Optional. Jupyter session config. - # @!attribute [r] creator - # @return [::String] - # Output only. The email address of the user who created the template. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Labels to associate with sessions created using this template. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** can be empty, but, if present, must contain 1 to 63 - # characters and conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with a session. - # @!attribute [rw] runtime_config - # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] - # Optional. Runtime configuration for session execution. - # @!attribute [rw] environment_config - # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] - # Optional. Environment configuration for session execution. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the template was last updated. - # @!attribute [r] uuid - # @return [::String] - # Output only. A session template UUID (Unique Universal Identifier). The - # service generates this value when it creates the session template. - class SessionTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb deleted file mode 100644 index 6c3dcab76966..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/sessions.rb +++ /dev/null @@ -1,295 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # A request to create a session. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this session will be created. - # @!attribute [rw] session - # @return [::Google::Cloud::Dataproc::V1::Session] - # Required. The interactive session to create. - # @!attribute [rw] session_id - # @return [::String] - # Required. The ID to use for the session, which becomes the final component - # of the session's resource name. - # - # This value must be 4-63 characters. Valid characters - # are /[a-z][0-9]-/. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - # with the same ID, the second request is ignored, and the - # first {::Google::Cloud::Dataproc::V1::Session Session} is created and stored in - # the backend. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class CreateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to get the resource representation for a session. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session to retrieve. - class GetSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list sessions in a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of sessions. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of sessions to return in each response. - # The service may return fewer than this value. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token received from a previous `ListSessions` call. - # Provide this token to retrieve the subsequent page. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter for the sessions to return in the response. - # - # A filter is a logical expression constraining the values of various fields - # in each session resource. Filters are case sensitive, and may contain - # multiple clauses combined with logical operators (AND, OR). - # Supported fields are `session_id`, `session_uuid`, `state`, and - # `create_time`. - # - # Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - # is a filter for sessions in an ACTIVE state that were created before - # 2023-01-01. - # - # See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - # description of the filter syntax and a list of supported comparators. - class ListSessionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of interactive sessions. - # @!attribute [r] sessions - # @return [::Array<::Google::Cloud::Dataproc::V1::Session>] - # Output only. The sessions from the specified collection. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token`, to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListSessionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to terminate an interactive session. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session resource to terminate. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class TerminateSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a session. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session resource to delete. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique ID used to identify the request. If the service - # receives two - # [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - # with the same ID, the second request is ignored. - # - # Recommendation: Set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The value must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class DeleteSessionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A representation of a session. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the session. - # @!attribute [r] uuid - # @return [::String] - # Output only. A session UUID (Unique Universal Identifier). The service - # generates this value when it creates the session. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the session was created. - # @!attribute [rw] jupyter_session - # @return [::Google::Cloud::Dataproc::V1::JupyterConfig] - # Optional. Jupyter session config. - # @!attribute [r] runtime_info - # @return [::Google::Cloud::Dataproc::V1::RuntimeInfo] - # Output only. Runtime information about session execution. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::Session::State] - # Output only. A state of the session. - # @!attribute [r] state_message - # @return [::String] - # Output only. Session state details, such as the failure - # description if the state is `FAILED`. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the session entered the current state. - # @!attribute [r] creator - # @return [::String] - # Output only. The email address of the user who created the session. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with the session. - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to [RFC - # 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - # associated with a session. - # @!attribute [rw] runtime_config - # @return [::Google::Cloud::Dataproc::V1::RuntimeConfig] - # Optional. Runtime configuration for the session execution. - # @!attribute [rw] environment_config - # @return [::Google::Cloud::Dataproc::V1::EnvironmentConfig] - # Optional. Environment configuration for the session execution. - # @!attribute [rw] user - # @return [::String] - # Optional. The email address of the user who owns the session. - # @!attribute [r] state_history - # @return [::Array<::Google::Cloud::Dataproc::V1::Session::SessionStateHistory>] - # Output only. Historical state information for the session. - # @!attribute [rw] session_template - # @return [::String] - # Optional. The session template used by the session. - # - # Only resource names, including project ID and location, are valid. - # - # Example: - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` - # * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` - # - # The template must be in the same project and Dataproc region as the - # session. - class Session - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Historical state information. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::Session::State] - # Output only. The state of the session at this point in the session - # history. - # @!attribute [r] state_message - # @return [::String] - # Output only. Details about the state at this point in the session - # history. - # @!attribute [r] state_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the session entered the historical state. - class SessionStateHistory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The session state. - module State - # The session state is unknown. - STATE_UNSPECIFIED = 0 - - # The session is created prior to running. - CREATING = 1 - - # The session is running. - ACTIVE = 2 - - # The session is terminating. - TERMINATING = 3 - - # The session is terminated successfully. - TERMINATED = 4 - - # The session is no longer running due to an error. - FAILED = 5 - end - end - - # Jupyter configuration for an interactive session. - # @!attribute [rw] kernel - # @return [::Google::Cloud::Dataproc::V1::JupyterConfig::Kernel] - # Optional. Kernel - # @!attribute [rw] display_name - # @return [::String] - # Optional. Display name, shown in the Jupyter kernelspec card. - class JupyterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Jupyter kernel types. - module Kernel - # The kernel is unknown. - KERNEL_UNSPECIFIED = 0 - - # Python kernel. - PYTHON = 1 - - # Scala kernel. - SCALA = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb deleted file mode 100644 index e8cb6f9d8267..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/shared.rb +++ /dev/null @@ -1,627 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # Runtime configuration for a workload. - # @!attribute [rw] version - # @return [::String] - # Optional. Version of the batch runtime. - # @!attribute [rw] container_image - # @return [::String] - # Optional. Optional custom container image for the job runtime environment. - # If not specified, a default container image will be used. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A mapping of property names to values, which are used to - # configure workload execution. - # @!attribute [rw] repository_config - # @return [::Google::Cloud::Dataproc::V1::RepositoryConfig] - # Optional. Dependency repository configuration. - # @!attribute [rw] autotuning_config - # @return [::Google::Cloud::Dataproc::V1::AutotuningConfig] - # Optional. Autotuning configuration of the workload. - # @!attribute [rw] cohort - # @return [::String] - # Optional. Cohort identifier. Identifies families of the workloads having - # the same shape, e.g. daily ETL jobs. - class RuntimeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Environment configuration for a workload. - # @!attribute [rw] execution_config - # @return [::Google::Cloud::Dataproc::V1::ExecutionConfig] - # Optional. Execution configuration for a workload. - # @!attribute [rw] peripherals_config - # @return [::Google::Cloud::Dataproc::V1::PeripheralsConfig] - # Optional. Peripherals configuration that workload has access to. - class EnvironmentConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Execution configuration for a workload. - # @!attribute [rw] service_account - # @return [::String] - # Optional. Service account that used to execute workload. - # @!attribute [rw] network_uri - # @return [::String] - # Optional. Network URI to connect workload to. - # @!attribute [rw] subnetwork_uri - # @return [::String] - # Optional. Subnetwork URI to connect workload to. - # @!attribute [rw] network_tags - # @return [::Array<::String>] - # Optional. Tags used for network traffic control. - # @!attribute [rw] kms_key - # @return [::String] - # Optional. The Cloud KMS key to use for encryption. - # @!attribute [rw] idle_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Applies to sessions only. The duration to keep the session alive - # while it's idling. Exceeding this threshold causes the session to - # terminate. This field cannot be set on a batch workload. Minimum value is - # 10 minutes; maximum value is 14 days (see JSON representation of - # [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # Defaults to 1 hour if not set. - # If both `ttl` and `idle_ttl` are specified for an interactive session, - # the conditions are treated as `OR` conditions: the workload will be - # terminated when it has been idle for `idle_ttl` or when `ttl` has been - # exceeded, whichever occurs first. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Optional. The duration after which the workload will be terminated, - # specified as the JSON representation for - # [Duration](https://protobuf.dev/programming-guides/proto3/#json). - # When the workload exceeds this duration, it will be unconditionally - # terminated without waiting for ongoing work to finish. If `ttl` is not - # specified for a batch workload, the workload will be allowed to run until - # it exits naturally (or run forever without exiting). If `ttl` is not - # specified for an interactive session, it defaults to 24 hours. If `ttl` is - # not specified for a batch that uses 2.1+ runtime version, it defaults to 4 - # hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl` - # and `idle_ttl` are specified (for an interactive session), the conditions - # are treated as `OR` conditions: the workload will be terminated when it has - # been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs - # first. - # @!attribute [rw] staging_bucket - # @return [::String] - # Optional. A Cloud Storage bucket used to stage workload dependencies, - # config files, and store workload output and other ephemeral data, such as - # Spark history files. If you do not specify a staging bucket, Cloud Dataproc - # will determine a Cloud Storage location according to the region where your - # workload is running, and then create and manage project-level, per-location - # staging and temporary buckets. - # **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - # a Cloud Storage bucket.** - class ExecutionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Spark History Server configuration for the workload. - # @!attribute [rw] dataproc_cluster - # @return [::String] - # Optional. Resource name of an existing Dataproc Cluster to act as a Spark - # History Server for the workload. - # - # Example: - # - # * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` - class SparkHistoryServerConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Auxiliary services configuration for a workload. - # @!attribute [rw] metastore_service - # @return [::String] - # Optional. Resource name of an existing Dataproc Metastore service. - # - # Example: - # - # * `projects/[project_id]/locations/[region]/services/[service_id]` - # @!attribute [rw] spark_history_server_config - # @return [::Google::Cloud::Dataproc::V1::SparkHistoryServerConfig] - # Optional. The Spark History Server configuration for the workload. - class PeripheralsConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Runtime information about workload execution. - # @!attribute [r] endpoints - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Map of remote access endpoints (such as web interfaces and - # APIs) to their URIs. - # @!attribute [r] output_uri - # @return [::String] - # Output only. A URI pointing to the location of the stdout and stderr of the - # workload. - # @!attribute [r] diagnostic_output_uri - # @return [::String] - # Output only. A URI pointing to the location of the diagnostics tarball. - # @!attribute [r] approximate_usage - # @return [::Google::Cloud::Dataproc::V1::UsageMetrics] - # Output only. Approximate workload resource usage, calculated when - # the workload completes (see [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # - # **Note:** This metric calculation may change in the future, for - # example, to capture cumulative workload resource - # consumption during workload execution (see the - # [Dataproc Serverless release notes] - # (https://cloud.google.com/dataproc-serverless/docs/release-notes) - # for announcements, changes, fixes - # and other Dataproc developments). - # @!attribute [r] current_usage - # @return [::Google::Cloud::Dataproc::V1::UsageSnapshot] - # Output only. Snapshot of current workload resource usage. - class RuntimeInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EndpointsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Usage metrics represent approximate total resources consumed by a workload. - # @!attribute [rw] milli_dcu_seconds - # @return [::Integer] - # Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`) - # (see [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # @!attribute [rw] shuffle_storage_gb_seconds - # @return [::Integer] - # Optional. Shuffle storage usage in (`GB` x `seconds`) (see - # [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # @!attribute [rw] milli_accelerator_seconds - # @return [::Integer] - # Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see - # [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # @!attribute [rw] accelerator_type - # @return [::String] - # Optional. Accelerator type being used, if any - class UsageMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The usage snapshot represents the resources consumed by a workload at a - # specified time. - # @!attribute [rw] milli_dcu - # @return [::Integer] - # Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see - # [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # @!attribute [rw] shuffle_storage_gb - # @return [::Integer] - # Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless - # pricing] (https://cloud.google.com/dataproc-serverless/pricing)) - # @!attribute [rw] milli_dcu_premium - # @return [::Integer] - # Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at - # premium tier (see [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)). - # @!attribute [rw] shuffle_storage_gb_premium - # @return [::Integer] - # Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see - # [Dataproc Serverless pricing] - # (https://cloud.google.com/dataproc-serverless/pricing)) - # @!attribute [rw] milli_accelerator - # @return [::Integer] - # Optional. Milli (one-thousandth) accelerator. (see [Dataproc - # Serverless pricing] (https://cloud.google.com/dataproc-serverless/pricing)) - # @!attribute [rw] accelerator_type - # @return [::String] - # Optional. Accelerator type being used, if any - # @!attribute [rw] snapshot_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The timestamp of the usage snapshot. - class UsageSnapshot - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The cluster's GKE config. - # @!attribute [rw] gke_cluster_target - # @return [::String] - # Optional. A target GKE cluster to deploy to. It must be in the same project - # and region as the Dataproc cluster (the GKE cluster can be zonal or - # regional). Format: - # 'projects/\\{project}/locations/\\{location}/clusters/\\{cluster_id}' - # @!attribute [rw] node_pool_target - # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolTarget>] - # Optional. GKE node pools where workloads will be scheduled. At least one - # node pool must be assigned the `DEFAULT` - # {::Google::Cloud::Dataproc::V1::GkeNodePoolTarget::Role GkeNodePoolTarget.Role}. - # If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT` - # `GkeNodePoolTarget`. Each role can be given to only one - # `GkeNodePoolTarget`. All node pools must have the same location settings. - class GkeClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for running the Dataproc cluster on Kubernetes. - # @!attribute [rw] kubernetes_namespace - # @return [::String] - # Optional. A namespace within the Kubernetes cluster to deploy into. If this - # namespace does not exist, it is created. If it exists, Dataproc verifies - # that another Dataproc VirtualCluster is not installed into it. If not - # specified, the name of the Dataproc Cluster is used. - # @!attribute [rw] gke_cluster_config - # @return [::Google::Cloud::Dataproc::V1::GkeClusterConfig] - # Required. The configuration for running the Dataproc cluster on GKE. - # @!attribute [rw] kubernetes_software_config - # @return [::Google::Cloud::Dataproc::V1::KubernetesSoftwareConfig] - # Optional. The software configuration for this Dataproc cluster running on - # Kubernetes. - class KubernetesClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The software configuration for this Dataproc cluster running on Kubernetes. - # @!attribute [rw] component_version - # @return [::Google::Protobuf::Map{::String => ::String}] - # The components that should be installed in this Dataproc cluster. The key - # must be a string from the KubernetesComponent enumeration. The value is - # the version of the software to be installed. - # At least one entry must be specified. - # @!attribute [rw] properties - # @return [::Google::Protobuf::Map{::String => ::String}] - # The properties to set on daemon config files. - # - # Property keys are specified in `prefix:property` format, for example - # `spark:spark.kubernetes.container.image`. The following are supported - # prefixes and their mappings: - # - # * spark: `spark-defaults.conf` - # - # For more information, see [Cluster - # properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). - class KubernetesSoftwareConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ComponentVersionEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class PropertiesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # GKE node pools that Dataproc workloads run on. - # @!attribute [rw] node_pool - # @return [::String] - # Required. The target GKE node pool. - # Format: - # 'projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/nodePools/\\{node_pool}' - # @!attribute [rw] roles - # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolTarget::Role>] - # Required. The roles associated with the GKE node pool. - # @!attribute [rw] node_pool_config - # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig] - # Input only. The configuration for the GKE node pool. - # - # If specified, Dataproc attempts to create a node pool with the - # specified shape. If one with the same name already exists, it is - # verified against all specified fields. If a field differs, the - # virtual cluster creation will fail. - # - # If omitted, any node pool with the specified name is used. If a - # node pool with the specified name does not exist, Dataproc create a - # node pool with default values. - # - # This is an input only field. It will not be returned by the API. - class GkeNodePoolTarget - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # `Role` specifies the tasks that will run on the node pool. Roles can be - # specific to workloads. Exactly one - # {::Google::Cloud::Dataproc::V1::GkeNodePoolTarget GkeNodePoolTarget} within the - # virtual cluster must have the `DEFAULT` role, which is used to run all - # workloads that are not associated with a node pool. - module Role - # Role is unspecified. - ROLE_UNSPECIFIED = 0 - - # At least one node pool must have the `DEFAULT` role. - # Work assigned to a role that is not associated with a node pool - # is assigned to the node pool with the `DEFAULT` role. For example, - # work assigned to the `CONTROLLER` role will be assigned to the node pool - # with the `DEFAULT` role if no node pool has the `CONTROLLER` role. - DEFAULT = 1 - - # Run work associated with the Dataproc control plane (for example, - # controllers and webhooks). Very low resource requirements. - CONTROLLER = 2 - - # Run work associated with a Spark driver of a job. - SPARK_DRIVER = 3 - - # Run work associated with a Spark executor of a job. - SPARK_EXECUTOR = 4 - end - end - - # The configuration of a GKE node pool used by a [Dataproc-on-GKE - # cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). - # @!attribute [rw] config - # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodeConfig] - # Optional. The node pool configuration. - # @!attribute [rw] locations - # @return [::Array<::String>] - # Optional. The list of Compute Engine - # [zones](https://cloud.google.com/compute/docs/zones#available) where - # node pool nodes associated with a Dataproc on GKE virtual cluster - # will be located. - # - # **Note:** All node pools associated with a virtual cluster - # must be located in the same region as the virtual cluster, and they must - # be located in the same zone within that region. - # - # If a location is not specified during node pool creation, Dataproc on GKE - # will choose the zone. - # @!attribute [rw] autoscaling - # @return [::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodePoolAutoscalingConfig] - # Optional. The autoscaler configuration for this node pool. The autoscaler - # is enabled only when a valid configuration is present. - class GkeNodePoolConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Parameters that describe cluster nodes. - # @!attribute [rw] machine_type - # @return [::String] - # Optional. The name of a Compute Engine [machine - # type](https://cloud.google.com/compute/docs/machine-types). - # @!attribute [rw] local_ssd_count - # @return [::Integer] - # Optional. The number of local SSD disks to attach to the node, which is - # limited by the maximum number of disks allowable per zone (see [Adding - # Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)). - # @!attribute [rw] preemptible - # @return [::Boolean] - # Optional. Whether the nodes are created as legacy [preemptible VM - # instances] (https://cloud.google.com/compute/docs/instances/preemptible). - # Also see - # {::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodeConfig#spot Spot} - # VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot - # preemptible nodes cannot be used in a node pool with the `CONTROLLER` - # [role] - # (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) - # or in the DEFAULT node pool if the CONTROLLER role is not assigned (the - # DEFAULT node pool will assume the CONTROLLER role). - # @!attribute [rw] accelerators - # @return [::Array<::Google::Cloud::Dataproc::V1::GkeNodePoolConfig::GkeNodePoolAcceleratorConfig>] - # Optional. A list of [hardware - # accelerators](https://cloud.google.com/compute/docs/gpus) to attach to - # each node. - # @!attribute [rw] min_cpu_platform - # @return [::String] - # Optional. [Minimum CPU - # platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - # to be used by this instance. The instance may be scheduled on the - # specified or a newer CPU platform. Specify the friendly names of CPU - # platforms, such as "Intel Haswell"` or Intel Sandy Bridge". - # @!attribute [rw] boot_disk_kms_key - # @return [::String] - # Optional. The [Customer Managed Encryption Key (CMEK)] - # (https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek) - # used to encrypt the boot disk attached to each node in the node pool. - # Specify the key using the following format: - # projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME. - # @!attribute [rw] spot - # @return [::Boolean] - # Optional. Whether the nodes are created as [Spot VM instances] - # (https://cloud.google.com/compute/docs/instances/spot). - # Spot VMs are the latest update to legacy - # [preemptible - # VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]. - # Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible - # nodes cannot be used in a node pool with the `CONTROLLER` - # [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) - # or in the DEFAULT node pool if the CONTROLLER role is not assigned (the - # DEFAULT node pool will assume the CONTROLLER role). - class GkeNodeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request - # for a node pool. - # @!attribute [rw] accelerator_count - # @return [::Integer] - # The number of accelerator cards exposed to an instance. - # @!attribute [rw] accelerator_type - # @return [::String] - # The accelerator type resource namename (see GPUs on Compute Engine). - # @!attribute [rw] gpu_partition_size - # @return [::String] - # Size of partitions to create on the GPU. Valid values are described in - # the NVIDIA [mig user - # guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - class GkeNodePoolAcceleratorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GkeNodePoolAutoscaling contains information the cluster autoscaler needs to - # adjust the size of the node pool to the current cluster usage. - # @!attribute [rw] min_node_count - # @return [::Integer] - # The minimum number of nodes in the node pool. Must be >= 0 and <= - # max_node_count. - # @!attribute [rw] max_node_count - # @return [::Integer] - # The maximum number of nodes in the node pool. Must be >= min_node_count, - # and must be > 0. - # **Note:** Quota must be sufficient to scale up the cluster. - class GkeNodePoolAutoscalingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Autotuning configuration of the workload. - # @!attribute [rw] scenarios - # @return [::Array<::Google::Cloud::Dataproc::V1::AutotuningConfig::Scenario>] - # Optional. Scenarios for which tunings are applied. - class AutotuningConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Scenario represents a specific goal that autotuning will attempt to achieve - # by modifying workloads. - module Scenario - # Default value. - SCENARIO_UNSPECIFIED = 0 - - # Scaling recommendations such as initialExecutors. - SCALING = 2 - - # Adding hints for potential relation broadcasts. - BROADCAST_HASH_JOIN = 3 - - # Memory management for workloads. - MEMORY = 4 - end - end - - # Configuration for dependency repositories - # @!attribute [rw] pypi_repository_config - # @return [::Google::Cloud::Dataproc::V1::PyPiRepositoryConfig] - # Optional. Configuration for PyPi repository. - class RepositoryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for PyPi repository - # @!attribute [rw] pypi_repository - # @return [::String] - # Optional. PyPi repository address - class PyPiRepositoryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cluster components that can be activated. - module Component - # Unspecified component. Specifying this will cause Cluster creation to fail. - COMPONENT_UNSPECIFIED = 0 - - # The Anaconda python distribution. The Anaconda component is not supported - # in the Dataproc [2.0 image] - # (/https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-release-2.0). - # The 2.0 image is pre-installed with Miniconda. - ANACONDA = 5 - - # Docker - DOCKER = 13 - - # The Druid query engine. (alpha) - DRUID = 9 - - # Flink - FLINK = 14 - - # HBase. (beta) - HBASE = 11 - - # The Hive Web HCatalog (the REST service for accessing HCatalog). - HIVE_WEBHCAT = 3 - - # Hudi. - HUDI = 18 - - # The Jupyter Notebook. - JUPYTER = 1 - - # The Presto query engine. - PRESTO = 6 - - # The Trino query engine. - TRINO = 17 - - # The Ranger service. - RANGER = 12 - - # The Solr service. - SOLR = 10 - - # The Zeppelin notebook. - ZEPPELIN = 4 - - # The Zookeeper service. - ZOOKEEPER = 8 - end - - # Actions in response to failure of a resource associated with a cluster. - module FailureAction - # When FailureAction is unspecified, failure action defaults to NO_ACTION. - FAILURE_ACTION_UNSPECIFIED = 0 - - # Take no action on failure to create a cluster resource. NO_ACTION is the - # default. - NO_ACTION = 1 - - # Delete the failed cluster resource. - DELETE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb deleted file mode 100644 index ad588c68d801..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb +++ /dev/null @@ -1,726 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Dataproc - module V1 - # A Dataproc workflow template resource. - # @!attribute [rw] id - # @return [::String] - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates`, the resource name of the - # template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates`, the resource name of the - # template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @!attribute [rw] version - # @return [::Integer] - # Optional. Used to perform a consistent read-modify-write. - # - # This field should be left blank for a `CreateWorkflowTemplate` request. It - # is required for an `UpdateWorkflowTemplate` request, and must match the - # current server version. A typical update template flow would fetch the - # current template with a `GetWorkflowTemplate` request, which will return - # the current template with the `version` field filled in with the - # current server version. The user updates other fields in the template, - # then returns it as part of the `UpdateWorkflowTemplate` request. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time template was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time template was last updated. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this template. These labels - # will be propagated to all jobs and clusters created by the workflow - # instance. - # - # Label **keys** must contain 1 to 63 characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # - # Label **values** may be empty, but, if present, must contain 1 to 63 - # characters, and must conform to - # [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - # - # No more than 32 labels can be associated with a template. - # @!attribute [rw] placement - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplatePlacement] - # Required. WorkflowTemplate scheduling information. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Dataproc::V1::OrderedJob>] - # Required. The Directed Acyclic Graph of Jobs to submit. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::Dataproc::V1::TemplateParameter>] - # Optional. Template parameters whose values are substituted into the - # template. Values for parameters must be provided when the template is - # instantiated. - # @!attribute [rw] dag_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Timeout duration for the DAG of jobs, expressed in seconds (see - # [JSON representation of - # duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # The timeout duration must be from 10 minutes ("600s") to 24 hours - # ("86400s"). The timer begins when the first job is submitted. If the - # workflow is running at the end of the timeout period, any remaining jobs - # are cancelled, the workflow is ended, and if the workflow was running on a - # [managed - # cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), - # the cluster is deleted. - class WorkflowTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Specifies workflow execution target. - # - # Either `managed_cluster` or `cluster_selector` is required. - # @!attribute [rw] managed_cluster - # @return [::Google::Cloud::Dataproc::V1::ManagedCluster] - # A cluster that is managed by the workflow. - # @!attribute [rw] cluster_selector - # @return [::Google::Cloud::Dataproc::V1::ClusterSelector] - # Optional. A selector that chooses target cluster for jobs based - # on metadata. - # - # The selector is evaluated at the time each job is submitted. - class WorkflowTemplatePlacement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cluster that is managed by the workflow. - # @!attribute [rw] cluster_name - # @return [::String] - # Required. The cluster name prefix. A unique cluster name will be formed by - # appending a random suffix. - # - # The name must contain only lower-case letters (a-z), numbers (0-9), - # and hyphens (-). Must begin with a letter. Cannot begin or end with - # hyphen. Must consist of between 2 and 35 characters. - # @!attribute [rw] config - # @return [::Google::Cloud::Dataproc::V1::ClusterConfig] - # Required. The cluster configuration. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this cluster. - # - # Label keys must be between 1 and 63 characters long, and must conform to - # the following PCRE regular expression: - # [\p\\{Ll}\p\\{Lo}][\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,62} - # - # Label values must be between 1 and 63 characters long, and must conform to - # the following PCRE regular expression: [\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,63} - # - # No more than 32 labels can be associated with a given cluster. - class ManagedCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A selector that chooses target cluster for jobs based on metadata. - # @!attribute [rw] zone - # @return [::String] - # Optional. The zone where workflow process executes. This parameter does not - # affect the selection of the cluster. - # - # If unspecified, the zone of the first cluster matching the selector - # is used. - # @!attribute [rw] cluster_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Required. The cluster labels. Cluster must have all labels - # to match. - class ClusterSelector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ClusterLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A job executed by the workflow. - # @!attribute [rw] step_id - # @return [::String] - # Required. The step id. The id must be unique among all jobs - # within the template. - # - # The step id is used as prefix for job id, as job - # `goog-dataproc-workflow-step-id` label, and in - # {::Google::Cloud::Dataproc::V1::OrderedJob#prerequisite_step_ids prerequisiteStepIds} - # field from other steps. - # - # The id must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). Cannot begin or end with underscore - # or hyphen. Must consist of between 3 and 50 characters. - # @!attribute [rw] hadoop_job - # @return [::Google::Cloud::Dataproc::V1::HadoopJob] - # Optional. Job is a Hadoop job. - # @!attribute [rw] spark_job - # @return [::Google::Cloud::Dataproc::V1::SparkJob] - # Optional. Job is a Spark job. - # @!attribute [rw] pyspark_job - # @return [::Google::Cloud::Dataproc::V1::PySparkJob] - # Optional. Job is a PySpark job. - # @!attribute [rw] hive_job - # @return [::Google::Cloud::Dataproc::V1::HiveJob] - # Optional. Job is a Hive job. - # @!attribute [rw] pig_job - # @return [::Google::Cloud::Dataproc::V1::PigJob] - # Optional. Job is a Pig job. - # @!attribute [rw] spark_r_job - # @return [::Google::Cloud::Dataproc::V1::SparkRJob] - # Optional. Job is a SparkR job. - # @!attribute [rw] spark_sql_job - # @return [::Google::Cloud::Dataproc::V1::SparkSqlJob] - # Optional. Job is a SparkSql job. - # @!attribute [rw] presto_job - # @return [::Google::Cloud::Dataproc::V1::PrestoJob] - # Optional. Job is a Presto job. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to associate with this job. - # - # Label keys must be between 1 and 63 characters long, and must conform to - # the following regular expression: - # [\p\\{Ll}\p\\{Lo}][\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,62} - # - # Label values must be between 1 and 63 characters long, and must conform to - # the following regular expression: [\p\\{Ll}\p\\{Lo}\p\\{N}_-]\\{0,63} - # - # No more than 32 labels can be associated with a given job. - # @!attribute [rw] scheduling - # @return [::Google::Cloud::Dataproc::V1::JobScheduling] - # Optional. Job scheduling configuration. - # @!attribute [rw] prerequisite_step_ids - # @return [::Array<::String>] - # Optional. The optional list of prerequisite job step_ids. - # If not specified, the job will start at the beginning of workflow. - class OrderedJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A configurable parameter that replaces one or more fields in the template. - # Parameterizable fields: - # - Labels - # - File uris - # - Job properties - # - Job arguments - # - Script variables - # - Main class (in HadoopJob and SparkJob) - # - Zone (in ClusterSelector) - # @!attribute [rw] name - # @return [::String] - # Required. Parameter name. - # The parameter name is used as the key, and paired with the - # parameter value, which are passed to the template when the template - # is instantiated. - # The name must contain only capital letters (A-Z), numbers (0-9), and - # underscores (_), and must not start with a number. The maximum length is - # 40 characters. - # @!attribute [rw] fields - # @return [::Array<::String>] - # Required. Paths to all fields that the parameter replaces. - # A field is allowed to appear in at most one parameter's list of field - # paths. - # - # A field path is similar in syntax to a - # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}. For example, a - # field path that references the zone field of a workflow template's cluster - # selector would be specified as `placement.clusterSelector.zone`. - # - # Also, field paths can reference fields using the following syntax: - # - # * Values in maps can be referenced by key: - # * labels['key'] - # * placement.clusterSelector.clusterLabels['key'] - # * placement.managedCluster.labels['key'] - # * placement.clusterSelector.clusterLabels['key'] - # * jobs['step-id'].labels['key'] - # - # * Jobs in the jobs list can be referenced by step-id: - # * jobs['step-id'].hadoopJob.mainJarFileUri - # * jobs['step-id'].hiveJob.queryFileUri - # * jobs['step-id'].pySparkJob.mainPythonFileUri - # * jobs['step-id'].hadoopJob.jarFileUris[0] - # * jobs['step-id'].hadoopJob.archiveUris[0] - # * jobs['step-id'].hadoopJob.fileUris[0] - # * jobs['step-id'].pySparkJob.pythonFileUris[0] - # - # * Items in repeated fields can be referenced by a zero-based index: - # * jobs['step-id'].sparkJob.args[0] - # - # * Other examples: - # * jobs['step-id'].hadoopJob.properties['key'] - # * jobs['step-id'].hadoopJob.args[0] - # * jobs['step-id'].hiveJob.scriptVariables['key'] - # * jobs['step-id'].hadoopJob.mainJarFileUri - # * placement.clusterSelector.zone - # - # It may not be possible to parameterize maps and repeated fields in their - # entirety since only individual map values and individual items in repeated - # fields can be referenced. For example, the following field paths are - # invalid: - # - # - placement.clusterSelector.clusterLabels - # - jobs['step-id'].sparkJob.args - # @!attribute [rw] description - # @return [::String] - # Optional. Brief description of the parameter. - # Must not exceed 1024 characters. - # @!attribute [rw] validation - # @return [::Google::Cloud::Dataproc::V1::ParameterValidation] - # Optional. Validation rules to be applied to this parameter's value. - class TemplateParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for parameter validation. - # @!attribute [rw] regex - # @return [::Google::Cloud::Dataproc::V1::RegexValidation] - # Validation based on regular expressions. - # @!attribute [rw] values - # @return [::Google::Cloud::Dataproc::V1::ValueValidation] - # Validation based on a list of allowed values. - class ParameterValidation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Validation based on regular expressions. - # @!attribute [rw] regexes - # @return [::Array<::String>] - # Required. RE2 regular expressions used to validate the parameter's value. - # The value must match the regex in its entirety (substring - # matches are not sufficient). - class RegexValidation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Validation based on a list of allowed values. - # @!attribute [rw] values - # @return [::Array<::String>] - # Required. List of allowed values for the parameter. - class ValueValidation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Dataproc workflow template resource. - # @!attribute [r] template - # @return [::String] - # Output only. The resource name of the workflow template as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates`, the resource name of the - # template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates`, the resource name of the - # template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @!attribute [r] version - # @return [::Integer] - # Output only. The version of template at the time of - # workflow instantiation. - # @!attribute [r] create_cluster - # @return [::Google::Cloud::Dataproc::V1::ClusterOperation] - # Output only. The create cluster operation metadata. - # @!attribute [r] graph - # @return [::Google::Cloud::Dataproc::V1::WorkflowGraph] - # Output only. The workflow graph. - # @!attribute [r] delete_cluster - # @return [::Google::Cloud::Dataproc::V1::ClusterOperation] - # Output only. The delete cluster operation metadata. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::WorkflowMetadata::State] - # Output only. The workflow state. - # @!attribute [r] cluster_name - # @return [::String] - # Output only. The name of the target cluster. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from parameter names to values that were used for those parameters. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Workflow start time. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Workflow end time. - # @!attribute [r] cluster_uuid - # @return [::String] - # Output only. The UUID of target cluster. - # @!attribute [r] dag_timeout - # @return [::Google::Protobuf::Duration] - # Output only. The timeout duration for the DAG of jobs, expressed in seconds - # (see [JSON representation of - # duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - # @!attribute [r] dag_start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. DAG start time, only set for workflows with - # {::Google::Cloud::Dataproc::V1::WorkflowMetadata#dag_timeout dag_timeout} when - # DAG begins. - # @!attribute [r] dag_end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. DAG end time, only set for workflows with - # {::Google::Cloud::Dataproc::V1::WorkflowMetadata#dag_timeout dag_timeout} when - # DAG ends. - class WorkflowMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParametersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The operation state. - module State - # Unused. - UNKNOWN = 0 - - # The operation has been created. - PENDING = 1 - - # The operation is running. - RUNNING = 2 - - # The operation is done; either cancelled or completed. - DONE = 3 - end - end - - # The cluster operation triggered by a workflow. - # @!attribute [r] operation_id - # @return [::String] - # Output only. The id of the cluster operation. - # @!attribute [r] error - # @return [::String] - # Output only. Error, if operation failed. - # @!attribute [r] done - # @return [::Boolean] - # Output only. Indicates the operation is done. - class ClusterOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The workflow graph. - # @!attribute [r] nodes - # @return [::Array<::Google::Cloud::Dataproc::V1::WorkflowNode>] - # Output only. The workflow nodes. - class WorkflowGraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The workflow node. - # @!attribute [r] step_id - # @return [::String] - # Output only. The name of the node. - # @!attribute [r] prerequisite_step_ids - # @return [::Array<::String>] - # Output only. Node's prerequisite nodes. - # @!attribute [r] job_id - # @return [::String] - # Output only. The job id; populated after the node enters RUNNING state. - # @!attribute [r] state - # @return [::Google::Cloud::Dataproc::V1::WorkflowNode::NodeState] - # Output only. The node state. - # @!attribute [r] error - # @return [::String] - # Output only. The error detail. - class WorkflowNode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The workflow node state. - module NodeState - # State is unspecified. - NODE_STATE_UNSPECIFIED = 0 - - # The node is awaiting prerequisite node to finish. - BLOCKED = 1 - - # The node is runnable but not running. - RUNNABLE = 2 - - # The node is running. - RUNNING = 3 - - # The node completed successfully. - COMPLETED = 4 - - # The node failed. A node can be marked FAILED because - # its ancestor or peer failed. - FAILED = 5 - end - end - - # A request to create a workflow template. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.create`, the resource name of the - # region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.create`, the resource name of - # the location has the following format: - # `projects/{project_id}/locations/{location}` - # @!attribute [rw] template - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # Required. The Dataproc workflow template to create. - class CreateWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to fetch a workflow template. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.get`, the resource name of the - # template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @!attribute [rw] version - # @return [::Integer] - # Optional. The version of workflow template to retrieve. Only previously - # instantiated versions can be retrieved. - # - # If unspecified, retrieves the current version. - class GetWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to instantiate a workflow template. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @!attribute [rw] version - # @return [::Integer] - # Optional. The version of workflow template to instantiate. If specified, - # the workflow will be instantiated only if the current version of - # the workflow template has the supplied version. - # - # This option cannot be used to instantiate a previous version of - # workflow template. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Map from parameter names to values that should be used for those - # parameters. Values may not exceed 1000 characters. - class InstantiateWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ParametersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A request to instantiate an inline workflow template. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,instantiateinline`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.instantiateinline`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @!attribute [rw] template - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # Required. The workflow template to instantiate. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A tag that prevents multiple concurrent workflow - # instances with the same tag from running. This mitigates risk of - # concurrent instances started due to retries. - # - # It is recommended to always set this value to a - # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - # - # The tag must contain only letters (a-z, A-Z), numbers (0-9), - # underscores (_), and hyphens (-). The maximum length is 40 characters. - class InstantiateInlineWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to update a workflow template. - # @!attribute [rw] template - # @return [::Google::Cloud::Dataproc::V1::WorkflowTemplate] - # Required. The updated workflow template. - # - # The `template.version` field must match the current version. - class UpdateWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to list workflow templates in a project. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the region or location, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates,list`, the resource - # name of the region has the following format: - # `projects/{project_id}/regions/{region}` - # - # * For `projects.locations.workflowTemplates.list`, the - # resource name of the location has the following format: - # `projects/{project_id}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to return in each response. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The page token, returned by a previous call, to request the - # next page of results. - class ListWorkflowTemplatesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A response to a request to list workflow templates in a project. - # @!attribute [r] templates - # @return [::Array<::Google::Cloud::Dataproc::V1::WorkflowTemplate>] - # Output only. WorkflowTemplates list. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. This token is included in the response if there are more - # results to fetch. To fetch additional results, provide this value as the - # page_token in a subsequent ListWorkflowTemplatesRequest. - class ListWorkflowTemplatesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to delete a workflow template. - # - # Currently started workflows will remain running. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the workflow template, as described - # in https://cloud.google.com/apis/design/resource_names. - # - # * For `projects.regions.workflowTemplates.delete`, the resource name - # of the template has the following format: - # `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - # - # * For `projects.locations.workflowTemplates.instantiate`, the resource name - # of the template has the following format: - # `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - # @!attribute [rw] version - # @return [::Integer] - # Optional. The version of workflow template to delete. If specified, - # will only delete the template if the current server version matches - # specified version. - class DeleteWorkflowTemplateRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index fb4d6862eac9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 8c6b19d52e3d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 8e7abcf8f052..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 5160138862c2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # Wrapper message for `double`. - # - # The JSON representation for `DoubleValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The double value. - class DoubleValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `float`. - # - # The JSON representation for `FloatValue` is JSON number. - # @!attribute [rw] value - # @return [::Float] - # The float value. - class FloatValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int64`. - # - # The JSON representation for `Int64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The int64 value. - class Int64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint64`. - # - # The JSON representation for `UInt64Value` is JSON string. - # @!attribute [rw] value - # @return [::Integer] - # The uint64 value. - class UInt64Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `int32`. - # - # The JSON representation for `Int32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The int32 value. - class Int32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `uint32`. - # - # The JSON representation for `UInt32Value` is JSON number. - # @!attribute [rw] value - # @return [::Integer] - # The uint32 value. - class UInt32Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bool`. - # - # The JSON representation for `BoolValue` is JSON `true` and `false`. - # @!attribute [rw] value - # @return [::Boolean] - # The bool value. - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `string`. - # - # The JSON representation for `StringValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The string value. - class StringValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wrapper message for `bytes`. - # - # The JSON representation for `BytesValue` is JSON string. - # @!attribute [rw] value - # @return [::String] - # The bytes value. - class BytesValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 09acc69b6125..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 41c8c3a565cc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb b/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb deleted file mode 100644 index ba88575c495d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/proto_docs/google/type/interval.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a time interval, encoded as a Timestamp start (inclusive) and a - # Timestamp end (exclusive). - # - # The start must be less than or equal to the end. - # When the start equals the end, the interval is empty (matches no time). - # When both start and end are unspecified, the interval matches any time. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Inclusive start of the interval. - # - # If specified, a Timestamp matching this interval will have to be the same - # or after the start. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Exclusive end of the interval. - # - # If specified, a Timestamp matching this interval will have to be before the - # end. - class Interval - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile deleted file mode 100644 index 399b57da62ae..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-dataproc-v1", path: "../" -else - gem "google-cloud-dataproc-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb deleted file mode 100644 index 1013c3635891..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_autoscaling_policy call in the AutoscalingPolicyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy. -# -def create_autoscaling_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new - - # Call the create_autoscaling_policy method. - result = client.create_autoscaling_policy request - - # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - p result -end -# [END dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb deleted file mode 100644 index 614430cd10ca..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_autoscaling_policy call in the AutoscalingPolicyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy. -# -def delete_autoscaling_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new - - # Call the delete_autoscaling_policy method. - result = client.delete_autoscaling_policy request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb deleted file mode 100644 index b4878b69f69d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_autoscaling_policy call in the AutoscalingPolicyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy. -# -def get_autoscaling_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new - - # Call the get_autoscaling_policy method. - result = client.get_autoscaling_policy request - - # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - p result -end -# [END dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb deleted file mode 100644 index dbeca302abb0..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_autoscaling_policies call in the AutoscalingPolicyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies. -# -def list_autoscaling_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new - - # Call the list_autoscaling_policies method. - result = client.list_autoscaling_policies request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. - p item - end -end -# [END dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb deleted file mode 100644 index f2b7fea4f4d9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the update_autoscaling_policy call in the AutoscalingPolicyService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy. -# -def update_autoscaling_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new - - # Call the update_autoscaling_policy method. - result = client.update_autoscaling_policy request - - # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. - p result -end -# [END dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb deleted file mode 100644 index 22943f710c46..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_BatchController_CreateBatch_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_batch call in the BatchController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::BatchController::Client#create_batch. -# -def create_batch - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::BatchController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new - - # Call the create_batch method. - result = client.create_batch request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_BatchController_CreateBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb deleted file mode 100644 index 2e0543267f4d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_BatchController_DeleteBatch_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_batch call in the BatchController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch. -# -def delete_batch - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::BatchController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new - - # Call the delete_batch method. - result = client.delete_batch request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dataproc_v1_generated_BatchController_DeleteBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb deleted file mode 100644 index 81cf2824caf9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_BatchController_GetBatch_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_batch call in the BatchController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::BatchController::Client#get_batch. -# -def get_batch - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::BatchController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetBatchRequest.new - - # Call the get_batch method. - result = client.get_batch request - - # The returned object is of type Google::Cloud::Dataproc::V1::Batch. - p result -end -# [END dataproc_v1_generated_BatchController_GetBatch_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb deleted file mode 100644 index 8632f4e50266..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_BatchController_ListBatches_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_batches call in the BatchController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::BatchController::Client#list_batches. -# -def list_batches - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::BatchController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new - - # Call the list_batches method. - result = client.list_batches request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. - p item - end -end -# [END dataproc_v1_generated_BatchController_ListBatches_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb deleted file mode 100644 index 31b268bc5b81..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_CreateCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb deleted file mode 100644 index 8bab1695944d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_DeleteCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb deleted file mode 100644 index 4d80905b018d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the diagnose_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster. -# -def diagnose_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new - - # Call the diagnose_cluster method. - result = client.diagnose_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb deleted file mode 100644 index 6c7eb2b60430..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_GetCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. - p result -end -# [END dataproc_v1_generated_ClusterController_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb deleted file mode 100644 index 1e8e38dc0d76..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_ListClusters_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_clusters call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. - p item - end -end -# [END dataproc_v1_generated_ClusterController_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb deleted file mode 100644 index c4af0a5092cb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_StartCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the start_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster. -# -def start_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::StartClusterRequest.new - - # Call the start_cluster method. - result = client.start_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_StartCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb deleted file mode 100644 index 5e3b6ed71412..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_StopCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the stop_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster. -# -def stop_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::StopClusterRequest.new - - # Call the stop_cluster method. - result = client.stop_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_StopCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb deleted file mode 100644 index 448a674c6830..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_ClusterController_UpdateCluster_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the update_cluster call in the ClusterController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::ClusterController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_ClusterController_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb deleted file mode 100644 index 9460258efc9e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_CancelJob_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the cancel_job call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#cancel_job. -# -def cancel_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CancelJobRequest.new - - # Call the cancel_job method. - result = client.cancel_job request - - # The returned object is of type Google::Cloud::Dataproc::V1::Job. - p result -end -# [END dataproc_v1_generated_JobController_CancelJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb deleted file mode 100644 index 9e698c5a7191..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_DeleteJob_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_job call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dataproc_v1_generated_JobController_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb deleted file mode 100644 index 2c32c1b86c10..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_GetJob_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_job call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Dataproc::V1::Job. - p result -end -# [END dataproc_v1_generated_JobController_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb deleted file mode 100644 index 3eeffe70a163..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_ListJobs_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_jobs call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::Job. - p item - end -end -# [END dataproc_v1_generated_JobController_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb deleted file mode 100644 index 067e8dca0d58..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_SubmitJob_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the submit_job call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#submit_job. -# -def submit_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - - # Call the submit_job method. - result = client.submit_job request - - # The returned object is of type Google::Cloud::Dataproc::V1::Job. - p result -end -# [END dataproc_v1_generated_JobController_SubmitJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb deleted file mode 100644 index f56e8e674c2d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the submit_job_as_operation call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation. -# -def submit_job_as_operation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new - - # Call the submit_job_as_operation method. - result = client.submit_job_as_operation request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb deleted file mode 100644 index e28bdccc6927..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_JobController_UpdateJob_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the update_job call in the JobController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::JobController::Client#update_job. -# -def update_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::JobController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new - - # Call the update_job method. - result = client.update_job request - - # The returned object is of type Google::Cloud::Dataproc::V1::Job. - p result -end -# [END dataproc_v1_generated_JobController_UpdateJob_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb deleted file mode 100644 index 31a35dfd5520..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/create_node_group.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_node_group call in the NodeGroupController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group. -# -def create_node_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new - - # Call the create_node_group method. - result = client.create_node_group request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb deleted file mode 100644 index 348430f95647..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/get_node_group.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_node_group call in the NodeGroupController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group. -# -def get_node_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new - - # Call the get_node_group method. - result = client.get_node_group request - - # The returned object is of type Google::Cloud::Dataproc::V1::NodeGroup. - p result -end -# [END dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb deleted file mode 100644 index 77651983eecf..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/node_group_controller/resize_node_group.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the resize_node_group call in the NodeGroupController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group. -# -def resize_node_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::NodeGroupController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new - - # Call the resize_node_group method. - result = client.resize_node_group request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb deleted file mode 100644 index 22145c40ff6f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/create_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionController_CreateSession_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_session call in the SessionController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionController::Client#create_session. -# -def create_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateSessionRequest.new - - # Call the create_session method. - result = client.create_session request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_SessionController_CreateSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb deleted file mode 100644 index cb5fedba7be8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/delete_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionController_DeleteSession_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_session call in the SessionController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionController::Client#delete_session. -# -def delete_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteSessionRequest.new - - # Call the delete_session method. - result = client.delete_session request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_SessionController_DeleteSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb deleted file mode 100644 index 7bc88ca7afc8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/get_session.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionController_GetSession_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_session call in the SessionController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionController::Client#get_session. -# -def get_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetSessionRequest.new - - # Call the get_session method. - result = client.get_session request - - # The returned object is of type Google::Cloud::Dataproc::V1::Session. - p result -end -# [END dataproc_v1_generated_SessionController_GetSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb deleted file mode 100644 index 7d1cf3e41e45..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/list_sessions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionController_ListSessions_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_sessions call in the SessionController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions. -# -def list_sessions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListSessionsRequest.new - - # Call the list_sessions method. - result = client.list_sessions request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::Session. - p item - end -end -# [END dataproc_v1_generated_SessionController_ListSessions_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb deleted file mode 100644 index 752d432d5d4c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_controller/terminate_session.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionController_TerminateSession_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the terminate_session call in the SessionController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session. -# -def terminate_session - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::TerminateSessionRequest.new - - # Call the terminate_session method. - result = client.terminate_session request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_SessionController_TerminateSession_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb deleted file mode 100644 index 60e89a646609..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/create_session_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_session_template call in the SessionTemplateController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template. -# -def create_session_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new - - # Call the create_session_template method. - result = client.create_session_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - p result -end -# [END dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb deleted file mode 100644 index 549873d4a4da..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/delete_session_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_session_template call in the SessionTemplateController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template. -# -def delete_session_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new - - # Call the delete_session_template method. - result = client.delete_session_template request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb deleted file mode 100644 index 02731253f9dc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/get_session_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_session_template call in the SessionTemplateController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template. -# -def get_session_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new - - # Call the get_session_template method. - result = client.get_session_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - p result -end -# [END dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb deleted file mode 100644 index 9347e8965aa4..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/list_session_templates.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_session_templates call in the SessionTemplateController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates. -# -def list_session_templates - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new - - # Call the list_session_templates method. - result = client.list_session_templates request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::SessionTemplate. - p item - end -end -# [END dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb deleted file mode 100644 index c7fb2ad26da6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/session_template_controller/update_session_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the update_session_template call in the SessionTemplateController service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template. -# -def update_session_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new - - # Call the update_session_template method. - result = client.update_session_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::SessionTemplate. - p result -end -# [END dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json b/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json deleted file mode 100644 index 4913822f1f17..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json +++ /dev/null @@ -1,1775 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-dataproc-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.dataproc.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync", - "title": "Snippet for the create_autoscaling_policy call in the AutoscalingPolicyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy.", - "file": "autoscaling_policy_service/create_autoscaling_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_autoscaling_policy", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", - "client": { - "short_name": "AutoscalingPolicyService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" - }, - "method": { - "short_name": "CreateAutoscalingPolicy", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", - "service": { - "short_name": "AutoscalingPolicyService", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync", - "title": "Snippet for the update_autoscaling_policy call in the AutoscalingPolicyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy.", - "file": "autoscaling_policy_service/update_autoscaling_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_autoscaling_policy", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", - "client": { - "short_name": "AutoscalingPolicyService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" - }, - "method": { - "short_name": "UpdateAutoscalingPolicy", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", - "service": { - "short_name": "AutoscalingPolicyService", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync", - "title": "Snippet for the get_autoscaling_policy call in the AutoscalingPolicyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy.", - "file": "autoscaling_policy_service/get_autoscaling_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_autoscaling_policy", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::AutoscalingPolicy", - "client": { - "short_name": "AutoscalingPolicyService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" - }, - "method": { - "short_name": "GetAutoscalingPolicy", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", - "service": { - "short_name": "AutoscalingPolicyService", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync", - "title": "Snippet for the list_autoscaling_policies call in the AutoscalingPolicyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies.", - "file": "autoscaling_policy_service/list_autoscaling_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_autoscaling_policies", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse", - "client": { - "short_name": "AutoscalingPolicyService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" - }, - "method": { - "short_name": "ListAutoscalingPolicies", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", - "service": { - "short_name": "AutoscalingPolicyService", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync", - "title": "Snippet for the delete_autoscaling_policy call in the AutoscalingPolicyService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy.", - "file": "autoscaling_policy_service/delete_autoscaling_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_autoscaling_policy", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "AutoscalingPolicyService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client" - }, - "method": { - "short_name": "DeleteAutoscalingPolicy", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", - "service": { - "short_name": "AutoscalingPolicyService", - "full_name": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_BatchController_CreateBatch_sync", - "title": "Snippet for the create_batch call in the BatchController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#create_batch.", - "file": "batch_controller/create_batch.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_batch", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#create_batch", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateBatchRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "BatchController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" - }, - "method": { - "short_name": "CreateBatch", - "full_name": "google.cloud.dataproc.v1.BatchController.CreateBatch", - "service": { - "short_name": "BatchController", - "full_name": "google.cloud.dataproc.v1.BatchController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_BatchController_GetBatch_sync", - "title": "Snippet for the get_batch call in the BatchController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#get_batch.", - "file": "batch_controller/get_batch.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_batch", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#get_batch", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetBatchRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Batch", - "client": { - "short_name": "BatchController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" - }, - "method": { - "short_name": "GetBatch", - "full_name": "google.cloud.dataproc.v1.BatchController.GetBatch", - "service": { - "short_name": "BatchController", - "full_name": "google.cloud.dataproc.v1.BatchController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_BatchController_ListBatches_sync", - "title": "Snippet for the list_batches call in the BatchController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#list_batches.", - "file": "batch_controller/list_batches.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_batches", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#list_batches", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListBatchesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListBatchesResponse", - "client": { - "short_name": "BatchController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" - }, - "method": { - "short_name": "ListBatches", - "full_name": "google.cloud.dataproc.v1.BatchController.ListBatches", - "service": { - "short_name": "BatchController", - "full_name": "google.cloud.dataproc.v1.BatchController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_BatchController_DeleteBatch_sync", - "title": "Snippet for the delete_batch call in the BatchController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch.", - "file": "batch_controller/delete_batch.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_batch", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteBatchRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "BatchController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::BatchController::Client" - }, - "method": { - "short_name": "DeleteBatch", - "full_name": "google.cloud.dataproc.v1.BatchController.DeleteBatch", - "service": { - "short_name": "BatchController", - "full_name": "google.cloud.dataproc.v1.BatchController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster.", - "file": "cluster_controller/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.CreateCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster.", - "file": "cluster_controller/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_StopCluster_sync", - "title": "Snippet for the stop_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster.", - "file": "cluster_controller/stop_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::StopClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "StopCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.StopCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_StartCluster_sync", - "title": "Snippet for the start_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster.", - "file": "cluster_controller/start_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::StartClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "StartCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.StartCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster.", - "file": "cluster_controller/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_GetCluster_sync", - "title": "Snippet for the get_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster.", - "file": "cluster_controller/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Cluster", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.GetCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_ListClusters_sync", - "title": "Snippet for the list_clusters call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters.", - "file": "cluster_controller/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListClustersResponse", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.dataproc.v1.ClusterController.ListClusters", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_ClusterController_DiagnoseCluster_sync", - "title": "Snippet for the diagnose_cluster call in the ClusterController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster.", - "file": "cluster_controller/diagnose_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "diagnose_cluster", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ClusterController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::ClusterController::Client" - }, - "method": { - "short_name": "DiagnoseCluster", - "full_name": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", - "service": { - "short_name": "ClusterController", - "full_name": "google.cloud.dataproc.v1.ClusterController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_SubmitJob_sync", - "title": "Snippet for the submit_job call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#submit_job.", - "file": "job_controller/submit_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "submit_job", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#submit_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::SubmitJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Job", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "SubmitJob", - "full_name": "google.cloud.dataproc.v1.JobController.SubmitJob", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_SubmitJobAsOperation_sync", - "title": "Snippet for the submit_job_as_operation call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation.", - "file": "job_controller/submit_job_as_operation.rb", - "language": "RUBY", - "client_method": { - "short_name": "submit_job_as_operation", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::SubmitJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "SubmitJobAsOperation", - "full_name": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_GetJob_sync", - "title": "Snippet for the get_job call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#get_job.", - "file": "job_controller/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Job", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.dataproc.v1.JobController.GetJob", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_ListJobs_sync", - "title": "Snippet for the list_jobs call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#list_jobs.", - "file": "job_controller/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListJobsResponse", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.dataproc.v1.JobController.ListJobs", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_UpdateJob_sync", - "title": "Snippet for the update_job call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#update_job.", - "file": "job_controller/update_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_job", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#update_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::UpdateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Job", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "UpdateJob", - "full_name": "google.cloud.dataproc.v1.JobController.UpdateJob", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_CancelJob_sync", - "title": "Snippet for the cancel_job call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#cancel_job.", - "file": "job_controller/cancel_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_job", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#cancel_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CancelJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Job", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "CancelJob", - "full_name": "google.cloud.dataproc.v1.JobController.CancelJob", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_JobController_DeleteJob_sync", - "title": "Snippet for the delete_job call in the JobController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::JobController::Client#delete_job.", - "file": "job_controller/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "JobController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::JobController::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.dataproc.v1.JobController.DeleteJob", - "service": { - "short_name": "JobController", - "full_name": "google.cloud.dataproc.v1.JobController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_NodeGroupController_CreateNodeGroup_sync", - "title": "Snippet for the create_node_group call in the NodeGroupController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group.", - "file": "node_group_controller/create_node_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_node_group", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#create_node_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "NodeGroupController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" - }, - "method": { - "short_name": "CreateNodeGroup", - "full_name": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", - "service": { - "short_name": "NodeGroupController", - "full_name": "google.cloud.dataproc.v1.NodeGroupController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_sync", - "title": "Snippet for the resize_node_group call in the NodeGroupController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group.", - "file": "node_group_controller/resize_node_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "resize_node_group", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#resize_node_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "NodeGroupController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" - }, - "method": { - "short_name": "ResizeNodeGroup", - "full_name": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", - "service": { - "short_name": "NodeGroupController", - "full_name": "google.cloud.dataproc.v1.NodeGroupController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_NodeGroupController_GetNodeGroup_sync", - "title": "Snippet for the get_node_group call in the NodeGroupController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group.", - "file": "node_group_controller/get_node_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_node_group", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client#get_node_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetNodeGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::NodeGroup", - "client": { - "short_name": "NodeGroupController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::NodeGroupController::Client" - }, - "method": { - "short_name": "GetNodeGroup", - "full_name": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", - "service": { - "short_name": "NodeGroupController", - "full_name": "google.cloud.dataproc.v1.NodeGroupController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionController_CreateSession_sync", - "title": "Snippet for the create_session call in the SessionController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#create_session.", - "file": "session_controller/create_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#create_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SessionController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" - }, - "method": { - "short_name": "CreateSession", - "full_name": "google.cloud.dataproc.v1.SessionController.CreateSession", - "service": { - "short_name": "SessionController", - "full_name": "google.cloud.dataproc.v1.SessionController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionController_GetSession_sync", - "title": "Snippet for the get_session call in the SessionController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#get_session.", - "file": "session_controller/get_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#get_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::Session", - "client": { - "short_name": "SessionController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" - }, - "method": { - "short_name": "GetSession", - "full_name": "google.cloud.dataproc.v1.SessionController.GetSession", - "service": { - "short_name": "SessionController", - "full_name": "google.cloud.dataproc.v1.SessionController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionController_ListSessions_sync", - "title": "Snippet for the list_sessions call in the SessionController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions.", - "file": "session_controller/list_sessions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sessions", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#list_sessions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListSessionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListSessionsResponse", - "client": { - "short_name": "SessionController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" - }, - "method": { - "short_name": "ListSessions", - "full_name": "google.cloud.dataproc.v1.SessionController.ListSessions", - "service": { - "short_name": "SessionController", - "full_name": "google.cloud.dataproc.v1.SessionController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionController_TerminateSession_sync", - "title": "Snippet for the terminate_session call in the SessionController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session.", - "file": "session_controller/terminate_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "terminate_session", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#terminate_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::TerminateSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SessionController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" - }, - "method": { - "short_name": "TerminateSession", - "full_name": "google.cloud.dataproc.v1.SessionController.TerminateSession", - "service": { - "short_name": "SessionController", - "full_name": "google.cloud.dataproc.v1.SessionController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionController_DeleteSession_sync", - "title": "Snippet for the delete_session call in the SessionController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionController::Client#delete_session.", - "file": "session_controller/delete_session.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client#delete_session", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteSessionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "SessionController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionController::Client" - }, - "method": { - "short_name": "DeleteSession", - "full_name": "google.cloud.dataproc.v1.SessionController.DeleteSession", - "service": { - "short_name": "SessionController", - "full_name": "google.cloud.dataproc.v1.SessionController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_sync", - "title": "Snippet for the create_session_template call in the SessionTemplateController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template.", - "file": "session_template_controller/create_session_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session_template", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#create_session_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", - "client": { - "short_name": "SessionTemplateController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" - }, - "method": { - "short_name": "CreateSessionTemplate", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", - "service": { - "short_name": "SessionTemplateController", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_sync", - "title": "Snippet for the update_session_template call in the SessionTemplateController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template.", - "file": "session_template_controller/update_session_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_session_template", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#update_session_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", - "client": { - "short_name": "SessionTemplateController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" - }, - "method": { - "short_name": "UpdateSessionTemplate", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", - "service": { - "short_name": "SessionTemplateController", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_sync", - "title": "Snippet for the get_session_template call in the SessionTemplateController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template.", - "file": "session_template_controller/get_session_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session_template", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#get_session_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::SessionTemplate", - "client": { - "short_name": "SessionTemplateController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" - }, - "method": { - "short_name": "GetSessionTemplate", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", - "service": { - "short_name": "SessionTemplateController", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_sync", - "title": "Snippet for the list_session_templates call in the SessionTemplateController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates.", - "file": "session_template_controller/list_session_templates.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_session_templates", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#list_session_templates", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse", - "client": { - "short_name": "SessionTemplateController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" - }, - "method": { - "short_name": "ListSessionTemplates", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", - "service": { - "short_name": "SessionTemplateController", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_sync", - "title": "Snippet for the delete_session_template call in the SessionTemplateController service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template.", - "file": "session_template_controller/delete_session_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session_template", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client#delete_session_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SessionTemplateController::Client", - "full_name": "::Google::Cloud::Dataproc::V1::SessionTemplateController::Client" - }, - "method": { - "short_name": "DeleteSessionTemplate", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", - "service": { - "short_name": "SessionTemplateController", - "full_name": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync", - "title": "Snippet for the create_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template.", - "file": "workflow_template_service/create_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "CreateWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync", - "title": "Snippet for the get_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template.", - "file": "workflow_template_service/get_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "GetWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync", - "title": "Snippet for the instantiate_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template.", - "file": "workflow_template_service/instantiate_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "instantiate_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "InstantiateWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync", - "title": "Snippet for the instantiate_inline_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template.", - "file": "workflow_template_service/instantiate_inline_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "instantiate_inline_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "InstantiateInlineWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync", - "title": "Snippet for the update_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template.", - "file": "workflow_template_service/update_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::WorkflowTemplate", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "UpdateWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync", - "title": "Snippet for the list_workflow_templates call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates.", - "file": "workflow_template_service/list_workflow_templates.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workflow_templates", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "ListWorkflowTemplates", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync", - "title": "Snippet for the delete_workflow_template call in the WorkflowTemplateService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template.", - "file": "workflow_template_service/delete_workflow_template.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workflow_template", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "WorkflowTemplateService::Client", - "full_name": "::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client" - }, - "method": { - "short_name": "DeleteWorkflowTemplate", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", - "service": { - "short_name": "WorkflowTemplateService", - "full_name": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb deleted file mode 100644 index 110943c02c87..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the create_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template. -# -def create_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new - - # Call the create_workflow_template method. - result = client.create_workflow_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - p result -end -# [END dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb deleted file mode 100644 index ed94503ab560..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the delete_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template. -# -def delete_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new - - # Call the delete_workflow_template method. - result = client.delete_workflow_template request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb deleted file mode 100644 index cb74684314dd..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the get_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template. -# -def get_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new - - # Call the get_workflow_template method. - result = client.get_workflow_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - p result -end -# [END dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb deleted file mode 100644 index 40356b98ecef..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the instantiate_inline_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template. -# -def instantiate_inline_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new - - # Call the instantiate_inline_workflow_template method. - result = client.instantiate_inline_workflow_template request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb deleted file mode 100644 index eda2221a3097..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the instantiate_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template. -# -def instantiate_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new - - # Call the instantiate_workflow_template method. - result = client.instantiate_workflow_template request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb deleted file mode 100644 index 9962ac035bae..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the list_workflow_templates call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates. -# -def list_workflow_templates - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new - - # Call the list_workflow_templates method. - result = client.list_workflow_templates request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. - p item - end -end -# [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb b/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb deleted file mode 100644 index ab55ae13bc03..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] -require "google/cloud/dataproc/v1" - -## -# Snippet for the update_workflow_template call in the WorkflowTemplateService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template. -# -def update_workflow_template - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new - - # Call the update_workflow_template method. - result = client.update_workflow_template request - - # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. - p result -end -# [END dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb deleted file mode 100644 index 9b7db69c4e43..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_paths_test.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/autoscaling_policy_service" - -class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_autoscaling_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.autoscaling_policy_path project: "value0", location: "value1", autoscaling_policy: "value2" - assert_equal "projects/value0/locations/value1/autoscalingPolicies/value2", path - - path = client.autoscaling_policy_path project: "value0", region: "value1", autoscaling_policy: "value2" - assert_equal "projects/value0/regions/value1/autoscalingPolicies/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_region_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.region_path project: "value0", region: "value1" - assert_equal "projects/value0/regions/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb deleted file mode 100644 index 24f5221a0c00..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_rest_test.rb +++ /dev/null @@ -1,364 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/autoscaling_policies_pb" -require "google/cloud/dataproc/v1/autoscaling_policy_service/rest" - - -class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_autoscaling_policy - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - policy = {} - - create_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_create_autoscaling_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_autoscaling_policy({ parent: parent, policy: policy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_autoscaling_policy parent: parent, policy: policy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_autoscaling_policy ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_autoscaling_policy({ parent: parent, policy: policy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_autoscaling_policy(::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_autoscaling_policy_client_stub.call_count - end - end - end - - def test_update_autoscaling_policy - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - policy = {} - - update_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_update_autoscaling_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_autoscaling_policy({ policy: policy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_autoscaling_policy policy: policy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_autoscaling_policy ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_autoscaling_policy({ policy: policy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_autoscaling_policy(::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_autoscaling_policy_client_stub.call_count - end - end - end - - def test_get_autoscaling_policy - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_get_autoscaling_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_autoscaling_policy({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_autoscaling_policy name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_autoscaling_policy ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_autoscaling_policy({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_autoscaling_policy(::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_autoscaling_policy_client_stub.call_count - end - end - end - - def test_list_autoscaling_policies - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_autoscaling_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_list_autoscaling_policies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_autoscaling_policies_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_autoscaling_policies parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_autoscaling_policies ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_autoscaling_policies(::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_autoscaling_policies_client_stub.call_count - end - end - end - - def test_delete_autoscaling_policy - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_autoscaling_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::ServiceStub.stub :transcode_delete_autoscaling_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_autoscaling_policy({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_autoscaling_policy name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_autoscaling_policy ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_autoscaling_policy({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_autoscaling_policy(::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_autoscaling_policy_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb deleted file mode 100644 index 5c583048bd04..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/autoscaling_policy_service_test.rb +++ /dev/null @@ -1,377 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/autoscaling_policies_pb" -require "google/cloud/dataproc/v1/autoscaling_policies_services_pb" -require "google/cloud/dataproc/v1/autoscaling_policy_service" - -class ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_autoscaling_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - policy = {} - - create_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_autoscaling_policy, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::AutoscalingPolicy), request["policy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_autoscaling_policy({ parent: parent, policy: policy }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_autoscaling_policy parent: parent, policy: policy do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_autoscaling_policy ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_autoscaling_policy({ parent: parent, policy: policy }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_autoscaling_policy(::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new(parent: parent, policy: policy), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_autoscaling_policy_client_stub.call_rpc_count - end - end - - def test_update_autoscaling_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - policy = {} - - update_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_autoscaling_policy, name - assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::AutoscalingPolicy), request["policy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_autoscaling_policy({ policy: policy }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_autoscaling_policy policy: policy do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_autoscaling_policy ::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_autoscaling_policy({ policy: policy }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_autoscaling_policy(::Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new(policy: policy), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_autoscaling_policy_client_stub.call_rpc_count - end - end - - def test_get_autoscaling_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::AutoscalingPolicy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_autoscaling_policy, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_autoscaling_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_autoscaling_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_autoscaling_policy ::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_autoscaling_policy({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_autoscaling_policy(::Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_autoscaling_policy_client_stub.call_rpc_count - end - end - - def test_list_autoscaling_policies - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_autoscaling_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_autoscaling_policies, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_autoscaling_policies_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_autoscaling_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_autoscaling_policies ::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_autoscaling_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_autoscaling_policies(::Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_autoscaling_policies_client_stub.call_rpc_count - end - end - - def test_delete_autoscaling_policy - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_autoscaling_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_autoscaling_policy, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_autoscaling_policy_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_autoscaling_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_autoscaling_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_autoscaling_policy ::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_autoscaling_policy({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_autoscaling_policy(::Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_autoscaling_policy_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb deleted file mode 100644 index 08b61efbdfa8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/batches_pb" -require "google/cloud/dataproc/v1/batches_services_pb" -require "google/cloud/dataproc/v1/batch_controller" - -class ::Google::Cloud::Dataproc::V1::BatchController::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::BatchController::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb deleted file mode 100644 index a69c9847e4c2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_paths_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/batch_controller" - -class ::Google::Cloud::Dataproc::V1::BatchController::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_batch_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.batch_path project: "value0", location: "value1", batch: "value2" - assert_equal "projects/value0/locations/value1/batches/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/services/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb deleted file mode 100644 index 4eb34166d9d9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_rest_test.rb +++ /dev/null @@ -1,314 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/batches_pb" -require "google/cloud/dataproc/v1/batch_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::BatchController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_batch - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - batch = {} - batch_id = "hello world" - request_id = "hello world" - - create_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_create_batch_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_batch parent: parent, batch: batch, batch_id: batch_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_batch ::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_batch(::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_batch_client_stub.call_count - end - end - end - - def test_get_batch - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Batch.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_get_batch_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_batch({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_batch name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_batch ::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_batch({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_batch(::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_batch_client_stub.call_count - end - end - end - - def test_list_batches - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_batches_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_list_batches_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_batches_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_batches parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_batches ::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_batches(::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_batches_client_stub.call_count - end - end - end - - def test_delete_batch - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_batch_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::BatchController::Rest::ServiceStub.stub :transcode_delete_batch_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_batch({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_batch name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_batch ::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_batch({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_batch(::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_batch_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb deleted file mode 100644 index cb853560fe82..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/batch_controller_test.rb +++ /dev/null @@ -1,346 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/batches_pb" -require "google/cloud/dataproc/v1/batches_services_pb" -require "google/cloud/dataproc/v1/batch_controller" - -class ::Google::Cloud::Dataproc::V1::BatchController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_batch - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - batch = {} - batch_id = "hello world" - request_id = "hello world" - - create_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_batch, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateBatchRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Batch), request["batch"] - assert_equal "hello world", request["batch_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_batch parent: parent, batch: batch, batch_id: batch_id, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_batch ::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_batch({ parent: parent, batch: batch, batch_id: batch_id, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_batch(::Google::Cloud::Dataproc::V1::CreateBatchRequest.new(parent: parent, batch: batch, batch_id: batch_id, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_batch_client_stub.call_rpc_count - end - end - - def test_get_batch - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Batch.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_batch, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetBatchRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_batch({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_batch name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_batch ::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_batch({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_batch(::Google::Cloud::Dataproc::V1::GetBatchRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_batch_client_stub.call_rpc_count - end - end - - def test_list_batches - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListBatchesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_batches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_batches, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListBatchesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_batches_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_batches parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_batches ::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_batches({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_batches(::Google::Cloud::Dataproc::V1::ListBatchesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_batches_client_stub.call_rpc_count - end - end - - def test_delete_batch - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_batch_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_batch, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteBatchRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_batch_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_batch({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_batch name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_batch ::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_batch({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_batch(::Google::Cloud::Dataproc::V1::DeleteBatchRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_batch_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::BatchController::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::BatchController::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb deleted file mode 100644 index d940559f0061..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/clusters_pb" -require "google/cloud/dataproc/v1/clusters_services_pb" -require "google/cloud/dataproc/v1/cluster_controller" - -class ::Google::Cloud::Dataproc::V1::ClusterController::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb deleted file mode 100644 index 8018d298871e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_paths_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/cluster_controller" - -class ::Google::Cloud::Dataproc::V1::ClusterController::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_node_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" - assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/services/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb deleted file mode 100644 index 19860ea432ad..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_rest_test.rb +++ /dev/null @@ -1,558 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/clusters_pb" -require "google/cloud/dataproc/v1/cluster_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster = {} - request_id = "hello world" - action_on_failed_primary_workers = :FAILURE_ACTION_UNSPECIFIED - - create_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster = {} - graceful_decommission_timeout = {} - update_mask = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_stop_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - stop_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_stop_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_cluster ::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_cluster(::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_cluster_client_stub.call_count - end - end - end - - def test_start_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - start_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_start_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_cluster ::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_cluster(::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - - get_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster project_id: project_id, region: region, cluster_name: cluster_name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListClustersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_clusters project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_count - end - end - end - - def test_diagnose_cluster - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - tarball_gcs_dir = "hello world" - tarball_access = :TARBALL_ACCESS_UNSPECIFIED - diagnosis_interval = {} - jobs = ["hello world"] - yarn_application_ids = ["hello world"] - - diagnose_cluster_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::ClusterController::Rest::ServiceStub.stub :transcode_diagnose_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, diagnose_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, diagnose_cluster_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb deleted file mode 100644 index a703e8bd2001..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/cluster_controller_test.rb +++ /dev/null @@ -1,659 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/clusters_pb" -require "google/cloud/dataproc/v1/clusters_services_pb" -require "google/cloud/dataproc/v1/cluster_controller" - -class ::Google::Cloud::Dataproc::V1::ClusterController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster = {} - request_id = "hello world" - action_on_failed_primary_workers = :FAILURE_ACTION_UNSPECIFIED - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal :FAILURE_ACTION_UNSPECIFIED, request["action_on_failed_primary_workers"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_cluster project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_cluster({ project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::Dataproc::V1::CreateClusterRequest.new(project_id: project_id, region: region, cluster: cluster, request_id: request_id, action_on_failed_primary_workers: action_on_failed_primary_workers), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster = {} - graceful_decommission_timeout = {} - update_mask = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Cluster), request["cluster"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["graceful_decommission_timeout"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::Dataproc::V1::UpdateClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster: cluster, graceful_decommission_timeout: graceful_decommission_timeout, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_rpc_count - end - end - - def test_stop_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - stop_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::StopClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - assert_equal "hello world", request["cluster_uuid"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stop_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stop_cluster ::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stop_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stop_cluster(::Google::Cloud::Dataproc::V1::StopClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, stop_cluster_client_stub.call_rpc_count - end - end - - def test_start_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - start_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::StartClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - assert_equal "hello world", request["cluster_uuid"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.start_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.start_cluster ::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.start_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.start_cluster(::Google::Cloud::Dataproc::V1::StartClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, start_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - cluster_uuid = "hello world" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - assert_equal "hello world", request["cluster_uuid"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_cluster project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::Dataproc::V1::DeleteClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, cluster_uuid: cluster_uuid, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Cluster.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - - get_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster project_id: project_id, region: region, cluster_name: cluster_name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ project_id: project_id, region: region, cluster_name: cluster_name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::Dataproc::V1::GetClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_rpc_count - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListClustersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListClustersRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_clusters project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_clusters ::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_clusters({ project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_clusters(::Google::Cloud::Dataproc::V1::ListClustersRequest.new(project_id: project_id, region: region, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_clusters_client_stub.call_rpc_count - end - end - - def test_diagnose_cluster - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - cluster_name = "hello world" - tarball_gcs_dir = "hello world" - tarball_access = :TARBALL_ACCESS_UNSPECIFIED - diagnosis_interval = {} - jobs = ["hello world"] - yarn_application_ids = ["hello world"] - - diagnose_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :diagnose_cluster, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["cluster_name"] - assert_equal "hello world", request["tarball_gcs_dir"] - assert_equal :TARBALL_ACCESS_UNSPECIFIED, request["tarball_access"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Type::Interval), request["diagnosis_interval"] - assert_equal ["hello world"], request["jobs"] - assert_equal ["hello world"], request["yarn_application_ids"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, diagnose_cluster_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, diagnose_cluster_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::ClusterController::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb deleted file mode 100644 index e0b5bc59a56f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/jobs_pb" -require "google/cloud/dataproc/v1/jobs_services_pb" -require "google/cloud/dataproc/v1/job_controller" - -class ::Google::Cloud::Dataproc::V1::JobController::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::JobController::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb deleted file mode 100644 index c7181d685f92..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_rest_test.rb +++ /dev/null @@ -1,491 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/jobs_pb" -require "google/cloud/dataproc/v1/job_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::JobController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_submit_job - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job = {} - request_id = "hello world" - - submit_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_submit_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, submit_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.submit_job project_id: project_id, region: region, job: job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.submit_job ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.submit_job(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, submit_job_client_stub.call_count - end - end - end - - def test_submit_job_as_operation - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job = {} - request_id = "hello world" - - submit_job_as_operation_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_submit_job_as_operation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, submit_job_as_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.submit_job_as_operation project_id: project_id, region: region, job: job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.submit_job_as_operation ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.submit_job_as_operation(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, submit_job_as_operation_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job project_id: project_id, region: region, job_id: job_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - page_size = 42 - page_token = "hello world" - cluster_name = "hello world" - job_state_matcher = :ALL - filter = "hello world" - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_update_job - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_update_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_job project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_job ::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_count - end - end - end - - def test_cancel_job - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - cancel_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_cancel_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_job project_id: project_id, region: region, job_id: job_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_job ::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_job(::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::JobController::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ project_id: project_id, region: region, job_id: job_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job project_id: project_id, region: region, job_id: job_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ project_id: project_id, region: region, job_id: job_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::JobController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb deleted file mode 100644 index a9665112c72f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/job_controller_test.rb +++ /dev/null @@ -1,550 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/jobs_pb" -require "google/cloud/dataproc/v1/jobs_services_pb" -require "google/cloud/dataproc/v1/job_controller" - -class ::Google::Cloud::Dataproc::V1::JobController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_submit_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job = {} - request_id = "hello world" - - submit_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :submit_job, name - assert_kind_of ::Google::Cloud::Dataproc::V1::SubmitJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, submit_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.submit_job project_id: project_id, region: region, job: job, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.submit_job ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.submit_job({ project_id: project_id, region: region, job: job, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.submit_job(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, submit_job_client_stub.call_rpc_count - end - end - - def test_submit_job_as_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job = {} - request_id = "hello world" - - submit_job_as_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :submit_job_as_operation, name - assert_kind_of ::Google::Cloud::Dataproc::V1::SubmitJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, submit_job_as_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.submit_job_as_operation project_id: project_id, region: region, job: job, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.submit_job_as_operation ::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.submit_job_as_operation({ project_id: project_id, region: region, job: job, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.submit_job_as_operation(::Google::Cloud::Dataproc::V1::SubmitJobRequest.new(project_id: project_id, region: region, job: job, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, submit_job_as_operation_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["job_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job project_id: project_id, region: region, job_id: job_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Dataproc::V1::GetJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - page_size = 42 - page_token = "hello world" - cluster_name = "hello world" - job_state_matcher = :ALL - filter = "hello world" - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListJobsRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["cluster_name"] - assert_equal :ALL, request["job_state_matcher"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_jobs project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_jobs({ project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Dataproc::V1::ListJobsRequest.new(project_id: project_id, region: region, page_size: page_size, page_token: page_token, cluster_name: cluster_name, job_state_matcher: job_state_matcher, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_rpc_count - end - end - - def test_update_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - job = {} - update_mask = {} - - update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_job, name - assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Job), request["job"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_job project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_job ::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_job({ project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_job(::Google::Cloud::Dataproc::V1::UpdateJobRequest.new(project_id: project_id, region: region, job_id: job_id, job: job, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_job_client_stub.call_rpc_count - end - end - - def test_cancel_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - cancel_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_job, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CancelJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["job_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_job project_id: project_id, region: region, job_id: job_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_job ::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_job(::Google::Cloud::Dataproc::V1::CancelJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - project_id = "hello world" - region = "hello world" - job_id = "hello world" - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteJobRequest, request - assert_equal "hello world", request["project_id"] - assert_equal "hello world", request["region"] - assert_equal "hello world", request["job_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ project_id: project_id, region: region, job_id: job_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job project_id: project_id, region: region, job_id: job_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ project_id: project_id, region: region, job_id: job_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Dataproc::V1::DeleteJobRequest.new(project_id: project_id, region: region, job_id: job_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::JobController::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::JobController::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb deleted file mode 100644 index fefa806d74c6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/node_groups_pb" -require "google/cloud/dataproc/v1/node_groups_services_pb" -require "google/cloud/dataproc/v1/node_group_controller" - -class ::Google::Cloud::Dataproc::V1::NodeGroupController::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb deleted file mode 100644 index 5cec88637d85..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_paths_test.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/node_group_controller" - -class ::Google::Cloud::Dataproc::V1::NodeGroupController::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_cluster_region_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_region_path project: "value0", region: "value1", cluster: "value2" - assert_equal "projects/value0/regions/value1/clusters/value2", path - end - end - - def test_node_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" - assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb deleted file mode 100644 index 0f7702673030..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_rest_test.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/node_groups_pb" -require "google/cloud/dataproc/v1/node_group_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_node_group - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - node_group = {} - node_group_id = "hello world" - request_id = "hello world" - - create_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_create_node_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_node_group parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_node_group ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_node_group(::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_node_group_client_stub.call_count - end - end - end - - def test_resize_node_group - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - size = 42 - request_id = "hello world" - graceful_decommission_timeout = {} - - resize_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_resize_node_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resize_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resize_node_group name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resize_node_group ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resize_node_group(::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resize_node_group_client_stub.call_count - end - end - end - - def test_get_node_group - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::NodeGroup.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_node_group_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::ServiceStub.stub :transcode_get_node_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_node_group({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_node_group name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_node_group ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_node_group({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_node_group(::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_node_group_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb deleted file mode 100644 index 07edbcfffde5..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/node_group_controller_test.rb +++ /dev/null @@ -1,286 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/node_groups_pb" -require "google/cloud/dataproc/v1/node_groups_services_pb" -require "google/cloud/dataproc/v1/node_group_controller" - -class ::Google::Cloud::Dataproc::V1::NodeGroupController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_node_group - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - node_group = {} - node_group_id = "hello world" - request_id = "hello world" - - create_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_node_group, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::NodeGroup), request["node_group"] - assert_equal "hello world", request["node_group_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_node_group parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_node_group ::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_node_group({ parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_node_group(::Google::Cloud::Dataproc::V1::CreateNodeGroupRequest.new(parent: parent, node_group: node_group, node_group_id: node_group_id, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_node_group_client_stub.call_rpc_count - end - end - - def test_resize_node_group - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - size = 42 - request_id = "hello world" - graceful_decommission_timeout = {} - - resize_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resize_node_group, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["size"] - assert_equal "hello world", request["request_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["graceful_decommission_timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resize_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resize_node_group name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resize_node_group ::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resize_node_group({ name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resize_node_group(::Google::Cloud::Dataproc::V1::ResizeNodeGroupRequest.new(name: name, size: size, request_id: request_id, graceful_decommission_timeout: graceful_decommission_timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resize_node_group_client_stub.call_rpc_count - end - end - - def test_get_node_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::NodeGroup.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_node_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_node_group, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_node_group_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_node_group({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_node_group name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_node_group ::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_node_group({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_node_group(::Google::Cloud::Dataproc::V1::GetNodeGroupRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_node_group_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::NodeGroupController::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::NodeGroupController::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb deleted file mode 100644 index cbac7503a6d6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/sessions_pb" -require "google/cloud/dataproc/v1/sessions_services_pb" -require "google/cloud/dataproc/v1/session_controller" - -class ::Google::Cloud::Dataproc::V1::SessionController::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionController::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb deleted file mode 100644 index 17cc5f86e43f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_paths_test.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/session_controller" - -class ::Google::Cloud::Dataproc::V1::SessionController::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/services/value2", path - end - end - - def test_session_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", location: "value1", session: "value2" - assert_equal "projects/value0/locations/value1/sessions/value2", path - end - end - - def test_session_template_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_template_path project: "value0", location: "value1", template: "value2" - assert_equal "projects/value0/locations/value1/sessionTemplates/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb deleted file mode 100644 index c8949ee6b987..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_rest_test.rb +++ /dev/null @@ -1,369 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/sessions_pb" -require "google/cloud/dataproc/v1/session_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::SessionController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_session - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - session_id = "hello world" - request_id = "hello world" - - create_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_create_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_session parent: parent, session: session, session_id: session_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_session ::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_count - end - end - end - - def test_get_session - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::Session.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_get_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_session({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_session name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_session ::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_session({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_count - end - end - end - - def test_list_sessions - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_sessions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_list_sessions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_count - end - end - end - - def test_terminate_session - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - terminate_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_terminate_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, terminate_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.terminate_session({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.terminate_session name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.terminate_session ::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.terminate_session({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.terminate_session(::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, terminate_session_client_stub.call_count - end - end - end - - def test_delete_session - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_session_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionController::Rest::ServiceStub.stub :transcode_delete_session_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_session({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_session name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_session ::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_session({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb deleted file mode 100644 index 52580344c7eb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_controller_test.rb +++ /dev/null @@ -1,416 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/sessions_pb" -require "google/cloud/dataproc/v1/sessions_services_pb" -require "google/cloud/dataproc/v1/session_controller" - -class ::Google::Cloud::Dataproc::V1::SessionController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_session - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session = {} - session_id = "hello world" - request_id = "hello world" - - create_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateSessionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::Session), request["session"] - assert_equal "hello world", request["session_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session parent: parent, session: session, session_id: session_id, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session ::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session({ parent: parent, session: session, session_id: session_id, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session(::Google::Cloud::Dataproc::V1::CreateSessionRequest.new(parent: parent, session: session, session_id: session_id, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_client_stub.call_rpc_count - end - end - - def test_get_session - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::Session.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetSessionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session ::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session(::Google::Cloud::Dataproc::V1::GetSessionRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_client_stub.call_rpc_count - end - end - - def test_list_sessions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListSessionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_sessions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sessions, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListSessionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sessions_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_sessions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_sessions ::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_sessions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_sessions(::Google::Cloud::Dataproc::V1::ListSessionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_sessions_client_stub.call_rpc_count - end - end - - def test_terminate_session - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - terminate_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :terminate_session, name - assert_kind_of ::Google::Cloud::Dataproc::V1::TerminateSessionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, terminate_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.terminate_session({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.terminate_session name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.terminate_session ::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.terminate_session({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.terminate_session(::Google::Cloud::Dataproc::V1::TerminateSessionRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, terminate_session_client_stub.call_rpc_count - end - end - - def test_delete_session - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - request_id = "hello world" - - delete_session_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteSessionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session({ name: name, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session name: name, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session ::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session({ name: name, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_session(::Google::Cloud::Dataproc::V1::DeleteSessionRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_session_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionController::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionController::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb deleted file mode 100644 index 0c4fc328676c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_paths_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/session_template_controller" - -class ::Google::Cloud::Dataproc::V1::SessionTemplateController::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/services/value2", path - end - end - - def test_session_template_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_template_path project: "value0", location: "value1", template: "value2" - assert_equal "projects/value0/locations/value1/sessionTemplates/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb deleted file mode 100644 index 1e392c9d3d5b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_rest_test.rb +++ /dev/null @@ -1,365 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/session_templates_pb" -require "google/cloud/dataproc/v1/session_template_controller/rest" - - -class ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_session_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session_template = {} - - create_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_create_session_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_session_template({ parent: parent, session_template: session_template }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_session_template parent: parent, session_template: session_template do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_session_template ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_session_template({ parent: parent, session_template: session_template }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_session_template(::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_session_template_client_stub.call_count - end - end - end - - def test_update_session_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session_template = {} - - update_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_update_session_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_session_template({ session_template: session_template }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_session_template session_template: session_template do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_session_template ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_session_template({ session_template: session_template }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_session_template(::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_session_template_client_stub.call_count - end - end - end - - def test_get_session_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_get_session_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_session_template({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_session_template name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_session_template ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_session_template({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_session_template(::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_session_template_client_stub.call_count - end - end - end - - def test_list_session_templates - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_session_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_list_session_templates_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_session_templates_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_session_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_session_templates ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_session_templates(::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_session_templates_client_stub.call_count - end - end - end - - def test_delete_session_template - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::ServiceStub.stub :transcode_delete_session_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_session_template({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_session_template name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_session_template ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_session_template({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_session_template(::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_session_template_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionTemplateController::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb deleted file mode 100644 index ca4068b9c38d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/session_template_controller_test.rb +++ /dev/null @@ -1,379 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/session_templates_pb" -require "google/cloud/dataproc/v1/session_templates_services_pb" -require "google/cloud/dataproc/v1/session_template_controller" - -class ::Google::Cloud::Dataproc::V1::SessionTemplateController::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_session_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session_template = {} - - create_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::SessionTemplate), request["session_template"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_session_template({ parent: parent, session_template: session_template }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_session_template parent: parent, session_template: session_template do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_session_template ::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_session_template({ parent: parent, session_template: session_template }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_session_template(::Google::Cloud::Dataproc::V1::CreateSessionTemplateRequest.new(parent: parent, session_template: session_template), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_template_client_stub.call_rpc_count - end - end - - def test_update_session_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - session_template = {} - - update_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_session_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::SessionTemplate), request["session_template"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_session_template({ session_template: session_template }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_session_template session_template: session_template do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_session_template ::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_session_template({ session_template: session_template }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_session_template(::Google::Cloud::Dataproc::V1::UpdateSessionTemplateRequest.new(session_template: session_template), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_session_template_client_stub.call_rpc_count - end - end - - def test_get_session_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::SessionTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_session_template({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_session_template name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_session_template ::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_session_template({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_session_template(::Google::Cloud::Dataproc::V1::GetSessionTemplateRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_session_template_client_stub.call_rpc_count - end - end - - def test_list_session_templates - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListSessionTemplatesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_session_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_session_templates, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_session_templates_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_session_templates parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_session_templates ::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_session_templates({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_session_templates(::Google::Cloud::Dataproc::V1::ListSessionTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_session_templates_client_stub.call_rpc_count - end - end - - def test_delete_session_template - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_session_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_session_template({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_session_template name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_session_template ::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_session_template({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_session_template(::Google::Cloud::Dataproc::V1::DeleteSessionTemplateRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_session_template_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::SessionTemplateController::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb deleted file mode 100644 index b32bcd2dad33..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/workflow_templates_pb" -require "google/cloud/dataproc/v1/workflow_templates_services_pb" -require "google/cloud/dataproc/v1/workflow_template_service" - -class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb deleted file mode 100644 index 33c8421bd454..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_paths_test.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/workflow_template_service" - -class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_node_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_group_path project: "value0", region: "value1", cluster: "value2", node_group: "value3" - assert_equal "projects/value0/regions/value1/clusters/value2/nodeGroups/value3", path - end - end - - def test_region_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.region_path project: "value0", region: "value1" - assert_equal "projects/value0/regions/value1", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", service: "value2" - assert_equal "projects/value0/locations/value1/services/value2", path - end - end - - def test_workflow_template_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workflow_template_path project: "value0", region: "value1", workflow_template: "value2" - assert_equal "projects/value0/regions/value1/workflowTemplates/value2", path - - path = client.workflow_template_path project: "value0", location: "value1", workflow_template: "value2" - assert_equal "projects/value0/locations/value1/workflowTemplates/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb deleted file mode 100644 index bf37fd83489d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_rest_test.rb +++ /dev/null @@ -1,479 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/dataproc/v1/workflow_templates_pb" -require "google/cloud/dataproc/v1/workflow_template_service/rest" - - -class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_workflow_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - template = {} - - create_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_create_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workflow_template({ parent: parent, template: template }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workflow_template parent: parent, template: template do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workflow_template ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workflow_template({ parent: parent, template: template }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workflow_template(::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workflow_template_client_stub.call_count - end - end - end - - def test_get_workflow_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - - get_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_get_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workflow_template({ name: name, version: version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workflow_template name: name, version: version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workflow_template ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workflow_template({ name: name, version: version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workflow_template(::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workflow_template_client_stub.call_count - end - end - end - - def test_instantiate_workflow_template - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - request_id = "hello world" - parameters = {} - - instantiate_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_instantiate_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, instantiate_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.instantiate_workflow_template name: name, version: version, request_id: request_id, parameters: parameters do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.instantiate_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.instantiate_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, instantiate_workflow_template_client_stub.call_count - end - end - end - - def test_instantiate_inline_workflow_template - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - template = {} - request_id = "hello world" - - instantiate_inline_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_instantiate_inline_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, instantiate_inline_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.instantiate_inline_workflow_template parent: parent, template: template, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.instantiate_inline_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.instantiate_inline_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, instantiate_inline_workflow_template_client_stub.call_count - end - end - end - - def test_update_workflow_template - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - template = {} - - update_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_update_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workflow_template({ template: template }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workflow_template template: template do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workflow_template ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workflow_template({ template: template }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workflow_template(::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workflow_template_client_stub.call_count - end - end - end - - def test_list_workflow_templates - # Create test objects. - client_result = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_workflow_templates_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_list_workflow_templates_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workflow_templates_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_workflow_templates parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_workflow_templates ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_workflow_templates(::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_workflow_templates_client_stub.call_count - end - end - end - - def test_delete_workflow_template - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - - delete_workflow_template_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::ServiceStub.stub :transcode_delete_workflow_template_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workflow_template({ name: name, version: version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workflow_template name: name, version: version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workflow_template ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workflow_template({ name: name, version: version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workflow_template(::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workflow_template_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb deleted file mode 100644 index f7d1d07e0585..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/google/cloud/dataproc/v1/workflow_template_service_test.rb +++ /dev/null @@ -1,531 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dataproc/v1/workflow_templates_pb" -require "google/cloud/dataproc/v1/workflow_templates_services_pb" -require "google/cloud/dataproc/v1/workflow_template_service" - -class ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - template = {} - - create_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workflow_template({ parent: parent, template: template }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_workflow_template parent: parent, template: template do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_workflow_template ::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_workflow_template({ parent: parent, template: template }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_workflow_template(::Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new(parent: parent, template: template), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_workflow_template_client_stub.call_rpc_count - end - end - - def test_get_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - - get_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workflow_template({ name: name, version: version }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workflow_template name: name, version: version do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workflow_template ::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workflow_template({ name: name, version: version }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_workflow_template(::Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new(name: name, version: version), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_workflow_template_client_stub.call_rpc_count - end - end - - def test_instantiate_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - request_id = "hello world" - parameters = {} - - instantiate_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :instantiate_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["version"] - assert_equal "hello world", request["request_id"] - assert_equal({}, request["parameters"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, instantiate_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.instantiate_workflow_template name: name, version: version, request_id: request_id, parameters: parameters do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.instantiate_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.instantiate_workflow_template({ name: name, version: version, request_id: request_id, parameters: parameters }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.instantiate_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new(name: name, version: version, request_id: request_id, parameters: parameters), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, instantiate_workflow_template_client_stub.call_rpc_count - end - end - - def test_instantiate_inline_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - template = {} - request_id = "hello world" - - instantiate_inline_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :instantiate_inline_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, instantiate_inline_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.instantiate_inline_workflow_template parent: parent, template: template, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.instantiate_inline_workflow_template ::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.instantiate_inline_workflow_template({ parent: parent, template: template, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.instantiate_inline_workflow_template(::Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new(parent: parent, template: template, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, instantiate_inline_workflow_template_client_stub.call_rpc_count - end - end - - def test_update_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::WorkflowTemplate.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - template = {} - - update_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dataproc::V1::WorkflowTemplate), request["template"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workflow_template({ template: template }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_workflow_template template: template do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_workflow_template ::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_workflow_template({ template: template }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_workflow_template(::Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new(template: template), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_workflow_template_client_stub.call_rpc_count - end - end - - def test_list_workflow_templates - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - - list_workflow_templates_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workflow_templates, name - assert_kind_of ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_workflow_templates_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_workflow_templates parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_workflow_templates ::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_workflow_templates({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_workflow_templates(::Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_workflow_templates_client_stub.call_rpc_count - end - end - - def test_delete_workflow_template - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - version = 42 - - delete_workflow_template_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workflow_template, name - assert_kind_of ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workflow_template_client_stub do - # Create client - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workflow_template({ name: name, version: version }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_workflow_template name: name, version: version do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_workflow_template ::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_workflow_template({ name: name, version: version }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_workflow_template(::Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new(name: name, version: version), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_workflow_template_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dataproc::V1::WorkflowTemplateService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb b/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb deleted file mode 100644 index 48407bca7edb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 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. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"